Giter Club home page Giter Club logo

emoji-parse's Introduction

emoji-parse

Little bit of PHP code to parse http://unicode.org/Public/emoji/13.0/emoji-test.txt into a workable PHP array.

Resulting array will look like (see: ./output/print_r.13.0.txt for complete output, or ./output/13.0.sql for mysql dump file):

Array
(
    [Smileys & People] => Array
        (
            [face-positive] => Array
                (
                    [0] => Array
                        (
                            [group] => Smileys & People
                            [subgroup] => face-positive
                            [name] => 1F600
                            [status] => fully-qualified
                            [emoji] => ๐Ÿ˜€
                            [description] => grinning face
                        )

                    [1] => Array
                        (
                            [group] => Smileys & People
                            [subgroup] => face-positive
                            [name] => 1F601
                            [status] => fully-qualified
                            [emoji] => ๐Ÿ˜
                            [description] => beaming face with smiling eyes
                        )

                    [2] => Array
                        (
                            [group] => Smileys & People
                            [subgroup] => face-positive
                            [name] => 1F602
                            [status] => fully-qualified
                            [emoji] => ๐Ÿ˜‚
                            [description] => face with tears of joy
                        )

                    [3] => Array
                        (
                            [group] => Smileys & People
                            [subgroup] => face-positive
                            [name] => 1F923
                            [status] => fully-qualified
                            [emoji] => ๐Ÿคฃ
                            [description] => rolling on the floor laughing
                        )
    // snip ..

emoji-parse's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

maxauri yahasana

emoji-parse's Issues

Notice: Undefined variable: group when parsing Unicode 13 TXT file.

Hi Lawrence - a few years ago you kindly helped me out with a Stack Overflow query and wrote this repository to help with that. Thank you again.

I don't know why, but the code works with the Unicode 5 spec but for some reason, does not work with the Unicode 13 spec.

When I run the code, I see these errors:

Notice: Undefined variable: group in C:\Apache24\htdocs\ch_0002a.php on line 41
Notice: Undefined variable: group in C:\Apache24\htdocs\ch_0002a.php on line 40

Where lines 40 and 41 are:

            $emoji[$group][$subgroup][] = [
                'group' => trim($group),

The two TXT files (versions 5 and 13) lay out the emoji data in the same structure, with the following convention - e.g.

# group: Smileys & Emotion
# subgroup: face-smiling
# subgroup: face-affection
# subgroup: face-tongue
...
# group: People & Body
# subgroup: hand-fingers-open
# subgroup: hand-fingers-partial
# subgroup: hand-single-finger
...

And so on.

The only difference I can see between the 2 text files is that the first # group occurs on line 23 on the version 5 TXT file and on line 33 on the version 13 TXT file, but I can't see the extra info in those additional 10 lines on the version 13 TXT file would cause this issue.

Sorry if I am missing something obvious.

Can you see what might be causing this?

Thanks very much for your time.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.