Skip to content

Commit

Permalink
Merge pull request #26 from NeelShah18/version_3.0
Browse files Browse the repository at this point in the history
Version 3.0
  • Loading branch information
NeelShah18 committed Aug 1, 2021
2 parents da2dabc + 019acf7 commit 53cd301
Show file tree
Hide file tree
Showing 16 changed files with 4,405 additions and 2,013 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/pythonpackage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
strategy:
max-parallel: 4
matrix:
python-version: [2.7, 3.5, 3.6, 3.7]
python-version: [3.5, 3.6, 3.7]

steps:
- uses: actions/checkout@v1
Expand Down
5 changes: 2 additions & 3 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
1) Start the issue.
2) I will review it in 2 days.
3) Aanyone can review that issue.
4) As problem solved, issue will be closed.
2) Issue will open for community support and possible solution.
3) As problem solved, issue will be closed.
2 changes: 1 addition & 1 deletion MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
include LICENSE.txt
include MANIFEST.in
include README.rst
include README.md
include setup.py
include setup.cfg
18 changes: 16 additions & 2 deletions PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,18 @@
# Title: Error name
# If you want to add emoji or emoticons:

## Description:
## Title: Adding/Modifiying - emoji/emoticons
- Add new emoji with unicode align with same standard as currently library has.
- Add new emoticons same format as we have.
- Run the test locally and show it works as expected.
- Provide python version and os version.
- Open pull request.
- assign "enhancement" tag.

# If you want to submit issue:

## Title: Error name

### Description:

- Explain error: Deatils about error
- Code: If code is able to regenrate error it will be easy for us to track.
Expand All @@ -10,3 +22,5 @@
- Suggetion: If you have any suggetion about code or error
- Extra info: If you want to add that feature or give extra information.



122 changes: 94 additions & 28 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,50 +2,116 @@

[![Documentation Status](http://readthedocs.org/projects/emot/badge/?version=latest)](https://emot.readthedocs.io/en/latest/?badge=latest)

Description of the emot library
Description of the emot:3.0 library
===============================

Emot is a python library to extract the emojis and emoticons from a
text(string). All the emojis and emoticons are taken from a reliable
source i.e. Wikipedia.org.
source details are listed in source section.

Emot 3.0 release moto is: high-performance detection library for data-science specially for large scale datasets of text.

Emot use advance dynamic pattern generation. It means everytime when you create object it generate pattern
based on the database(emo_unicode.py). You can add/delete/modify that file under library to create other dynamic pattern.

3.0 version provide more option such as bulk processing. It is useful when you have long list of "sentence or word"
and want to use multiprocessing power to speedup the process.

It means you can dynamically create pattern for the emoji or emoticons and run it in multiprocessing to get maximum
performance from multiple cores.

Again, I am thankful for all support and help from the community around the world. I hope this will help and make your
life easier.

Compatibility
-------------

It works fine in any Python 2.xx and 3.xx.
version 3.0 only support python 3.X.

Python 2.X is no longer supported.

Working
-------

The Emot library takes a string as an input and returns a list of
dictonary.
The Emot library takes a string/list of string as an input and returns a dictonary.

There are one class name emot containing four different function.

emot.emoji:

- Input: It has one input: string
- Output: It will return dictionary with 4 different value: dict
- value = list of emojis
- location = list of location list of emojis
- mean = list of meaning
- flag = True/False. False means library didn't find anything and True means we find something.

emot.emoticons

- Input: It has one input: string
- Output: It will return dictionary with 4 different value: dict
- value = list of emoticons
- location = list of location list of emoticons
- mean = list of meaning
- flag = True/False. False means library didn't find anything and True means we find something.

emot.bulk_emoji

- Input: Two input: List of string and CPU cores pool: list[], int
- By default CPU cores pool value is half of total available cores: multiprocessing.cpu_count()/2
- Output: It will return **list of dictionary** with 4 different value: list of dict
- value = list of emojis
- location = list of location list of emojis
- mean = list of meaning
- flag = True/False. False means library didn't find anything and True means we find something.

emot.bulk_emoticons

- Input: Two input: List of string and CPU cores pool: list[], int
- By default CPU cores pool value is half of total available cores: multiprocessing.cpu_count()/2
- Output: It will return **list of dictionary** with 4 different value: list of dict
- value = list of emoticons
- location = list of location list of emoticons
- mean = list of meaning
- flag = True/False. False means library didn't find anything and True means we find something.


Example
-------

>>> import emot
>>> text = "I love python 👨 :-)"
>>> emot.emoji(text)
>>> [{'value': '👨', 'mean': ':man:', 'location': [14, 14], 'flag': True}]
>>> emot.emoticons(text)
>>> {'value': [':-)'], 'location': [[16, 19]], 'mean': ['Happy face smiley'], 'flag': True}

New version 2.0 of emot library return dictonary of and you can loop every data based on below example.
Here, value, location, mean are list and flag is boolean.

>>> text = "I love python 👨 :-)"
>>> ans = emot.emoticons(text)
>>> ans
{'value': [':-)'], 'location': [[16, 19]], 'mean': ['Happy face smiley'], 'flag': True}
>>> ans['value']
':-)'
>>> ans['location']
[16, 19]
>>> ans['mean']
['Happy face smiley']
>>> ans['flag']
True
>>> import emot
>>> emot_obj = emot.emot()
>>> text = "I love python ☮ 🙂 ❤ :-) :-( :-)))"
>>> emot_obj.emoji(test)
>>> {'value': ['☮', '🙂', '❤'], 'location': [[14, 15], [16, 17], [18, 19]], 'mean': [':peace_symbol:',
':slightly_smiling_face:', ':red_heart:'], 'flag': True}
>>> emot_obj.emoticons(test) >>> {'value': [':-)', ':-(', ':-)))'], 'location': [[20, 23], [24, 27], [28, 33]],
'mean': ['Happy face smiley', 'Frown, sad, andry or pouting', 'Very very Happy face or smiley'], 'flag': True}

Running bulk string emoji and emoticons detection. When user has access multiple processing cores.

>>> import emot
>>> emot_obj = emot.emot()
>>> bulk_test = ["I love python ☮ 🙂 ❤ :-) :-( :-)))", "I love python
🙂 ❤ :-) :-( :-)))", "I love python ☮ ❤ :-) :-( :-)))", "I love python ☮ 🙂 :-( :-)))"]
>>>
>>> emot_obj.bulk_emoji(bulk_test)
>>> [{'value': ['☮', '🙂', '❤'], 'location': [[14, 15], [16, 17], [18, 19]],
'mean': [':peace_symbol:', ':slightly_smiling_face:', ':red_heart:'], 'flag': True}, {'value': ['🙂', '❤'],
'location': [[14, 15], [16, 17]], 'mean': [':slightly_smiling_face:', ':red_heart:'], 'flag': True}, {'value': [
'☮', '❤'], 'location': [[14, 15], [16, 17]], 'mean': [':peace_symbol:', ':red_heart:'], 'flag': True},
{'value': ['☮', '🙂'], 'location': [[14, 15], [16, 17]], 'mean': [':peace_symbol:', ':slightly_smiling_face:'],
'flag': True}]
>>>
>>> emot_obj.bulk_emoticons(bulk_test)
>>> [{'value': [':-)', ':-(', ':-)))'], 'location': [[20, 23], [24, 27], [28, 33]], 'mean': ['Happy face smiley',
'Frown, sad, andry or pouting', 'Very very Happy face or smiley'], 'flag': True}, {'value': [':-)', ':-(', ':-)))'],
'location': [[18, 21], [22, 25], [26, 31]], 'mean': ['Happy face smiley', 'Frown, sad, andry or pouting', 'Very
very Happy face or smiley'], 'flag': True}, {'value': [':-)', ':-(', ':-)))'], 'location': [[18, 21], [22, 25],
[26, 31]], 'mean': ['Happy face smiley', 'Frown, sad, andry or pouting', 'Very very Happy face or smiley'],
'flag': True}, {'value': [':-(', ':-)))'], 'location': [[18, 21], [22, 27]], 'mean': ['Frown, sad, andry or
pouting', 'Very very Happy face or smiley'], 'flag': True}]

Installation
------------

Expand All @@ -65,7 +131,7 @@ Developing
$ git clone https://github.com/NeelShah18/emot.git
$ cd emot

Links
Sources
-----

[Emoji Cheat Sheet]
Expand Down
19 changes: 10 additions & 9 deletions emot/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,16 @@
"""

from emot.core import emoji
from emot.core import emoticons
from emot.emo_unicode import EMO_UNICODE
from emot.emo_unicode import UNICODE_EMO
from emot.emo_unicode import EMOTICONS

__version__ = '0.0.1'
__author__ = 'Neel Shah and Shubham'
__email__ = 'neelknightme@gmail.com and kaka.shubham@gmail.com'
from emot.core import emot
from emot.emo_unicode import EMOJI_UNICODE
from emot.emo_unicode import UNICODE_EMOJI
from emot.emo_unicode import EMOTICONS_EMO
from emot.emo_unicode import EMOJI_ALIAS_UNICODE
from emot.emo_unicode import UNICODE_EMOJI_ALIAS

__version__ = '3.0.0'
__author__ = 'Neel Shah'
__email__ = 'neelknightme@gmail.com'
__source__ = 'https://github.com/NeelShah18/emot'
__license__ = '''
Expand Down

0 comments on commit 53cd301

Please sign in to comment.