Skip to content

Commit

Permalink
Release v5.1.1
Browse files Browse the repository at this point in the history
  • Loading branch information
vdurmont committed Sep 9, 2019
1 parent 498714d commit fedae2f
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 25 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog

## v5.1.1

- Bugfix: respect fitzpatrick modifier when extracting emojis (thanks @sullis)

## v5.1.0

- Many performance improvements to the parsing of the emojis (thanks @freva)
Expand Down
46 changes: 23 additions & 23 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ _The missing emoji library for java._
<dependency>
<groupId>com.vdurmont</groupId>
<artifactId>emoji-java</artifactId>
<version>5.1.0</version>
<version>5.1.1</version>
</dependency>
```

Expand All @@ -25,46 +25,46 @@ You can also download the project, build it with `mvn clean install` and add the
##### Via Gradle:

```gradle
compile 'com.vdurmont:emoji-java:5.1.0'
compile 'com.vdurmont:emoji-java:5.1.1'
```

##### Via Direct Download:

- Use [releases](https://github.com/vdurmont/emoji-java/releases) tab to download the jar directly.
- Download JSON-java dependency from http://mvnrepository.com/artifact/org.json/json.
- Use [releases](https://github.com/vdurmont/emoji-java/releases) tab to download the jar directly.
- Download JSON-java dependency from http://mvnrepository.com/artifact/org.json/json.

## How to use it?

### EmojiManager

The `EmojiManager` provides several static methods to search through the emojis database:

- `getForTag` returns all the emojis for a given tag
- `getForAlias` returns the emoji for an alias
- `getAll` returns all the emojis
- `isEmoji` checks if a string is an emoji
- `containsEmoji` checks if a string contains any emoji
- `getForTag` returns all the emojis for a given tag
- `getForAlias` returns the emoji for an alias
- `getAll` returns all the emojis
- `isEmoji` checks if a string is an emoji
- `containsEmoji` checks if a string contains any emoji

You can also query the metadata:

- `getAllTags` returns the available tags
- `getAllTags` returns the available tags

Or get everything:

- `getAll` returns all the emojis
- `getAll` returns all the emojis

### Emoji model

An `Emoji` is a POJO (plain old java object), which provides the following methods:

- `getUnicode` returns the unicode representation of the emoji
- `getUnicode(Fitzpatrick)` returns the unicode representation of the emoji with the provided Fitzpatrick modifier. If the emoji doesn't support the Fitzpatrick modifiers, this method will throw an `UnsupportedOperationException`. If the provided Fitzpatrick is null, this method will return the unicode of the emoji.
- `getDescription` returns the (optional) description of the emoji
- `getAliases` returns a list of aliases for this emoji
- `getTags` returns a list of tags for this emoji
- `getHtmlDecimal` returns an html decimal representation of the emoji
- `getHtmlHexadecimal` returns an html decimal representation of the emoji
- `supportsFitzpatrick` returns true if the emoji supports the Fitzpatrick modifiers, else false
- `getUnicode` returns the unicode representation of the emoji
- `getUnicode(Fitzpatrick)` returns the unicode representation of the emoji with the provided Fitzpatrick modifier. If the emoji doesn't support the Fitzpatrick modifiers, this method will throw an `UnsupportedOperationException`. If the provided Fitzpatrick is null, this method will return the unicode of the emoji.
- `getDescription` returns the (optional) description of the emoji
- `getAliases` returns a list of aliases for this emoji
- `getTags` returns a list of tags for this emoji
- `getHtmlDecimal` returns an html decimal representation of the emoji
- `getHtmlHexadecimal` returns an html decimal representation of the emoji
- `supportsFitzpatrick` returns true if the emoji supports the Fitzpatrick modifiers, else false

### Fitzpatrick modifiers

Expand Down Expand Up @@ -173,9 +173,9 @@ The same applies for the methods `EmojiParser#parseToHtmlHexadecimal(String)` an

You can easily remove emojis from a string using one of the following methods:

- `EmojiParser#removeAllEmojis(String)`: removes all the emojis from the String
- `EmojiParser#removeAllEmojisExcept(String, Collection<Emoji>)`: removes all the emojis from the String, except the ones in the Collection
- `EmojiParser#removeEmojis(String, Collection<Emoji>)`: removes the emojis in the Collection from the String
- `EmojiParser#removeAllEmojis(String)`: removes all the emojis from the String
- `EmojiParser#removeAllEmojisExcept(String, Collection<Emoji>)`: removes all the emojis from the String, except the ones in the Collection
- `EmojiParser#removeEmojis(String, Collection<Emoji>)`: removes the emojis in the Collection from the String

For example:

Expand All @@ -198,7 +198,7 @@ System.out.println(EmojiParser.removeEmojis(str, collection));

You can search a string of mixed emoji/non-emoji characters and have all of the emoji characters returned as a Collection.

- `EmojiParser#extractEmojis(String)`: returns all emojis as a Collection. This will include duplicates if emojis are present more than once.
- `EmojiParser#extractEmojis(String)`: returns all emojis as a Collection. This will include duplicates if emojis are present more than once.

## Credits

Expand Down
2 changes: 1 addition & 1 deletion emoji-table-generator/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
<dependency>
<groupId>com.vdurmont</groupId>
<artifactId>emoji-java</artifactId>
<version>5.1.0</version>
<version>5.1.1</version>
</dependency>
</dependencies>
</project>
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

<groupId>com.vdurmont</groupId>
<artifactId>emoji-java</artifactId>
<version>5.1.0</version>
<version>5.1.1</version>
<packaging>jar</packaging>

<name>emoji-java</name>
Expand Down

0 comments on commit fedae2f

Please sign in to comment.