Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Persian text bugs were fixed #7

Merged
merged 4 commits into from Dec 14, 2021
Merged

Persian text bugs were fixed #7

merged 4 commits into from Dec 14, 2021

Conversation

siniorone
Copy link
Collaborator

The emojis have been removed as a result of these modifications.
More complicated and nested messages are successfully extracted.
The project was updated with more stop words, and the user was encouraged to use the Vazir font.

Comment on lines 108 to 111
regrex_pattern = re.compile(pattern = "["
"\u2069"
"\u2066"
"]+", flags = re.UNICODE)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is this? Did you simply mean "[\u2069\u2066]+"? What are the spaces for?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Previously, the function was intended for more characters.
After the suspicious characters were reduced, the function's structure was not modified.
Thanks a lot.
Your suggestion has been added to the new commits.

"\u2069"
"\u2066"
"]+", flags = re.UNICODE)
text = regrex_pattern.sub(r'', text)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No need for the r prefix here.

Suggested change
text = regrex_pattern.sub(r'', text)
text = regrex_pattern.sub('', text)

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

r prefix was deleted in the new commits

Comment on lines 7 to 8
import demoji
import arabic_reshaper
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

import is not sorted.

Suggested change
import demoji
import arabic_reshaper
import arabic_reshaper
import demoji

Copy link
Collaborator Author

@siniorone siniorone Dec 14, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

imports was sorted in the new commits

Comment on lines 135 to 136
elif isinstance(sub_msg, dict) and sub_msg['type'] in {
'text_link', 'bold', 'italic', 'hashtag', 'mention', 'pre'}:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Better indentation:

Suggested change
elif isinstance(sub_msg, dict) and sub_msg['type'] in {
'text_link', 'bold', 'italic', 'hashtag', 'mention', 'pre'}:
elif isinstance(sub_msg, dict) and sub_msg['type'] in {
'text_link', 'bold', 'italic', 'hashtag', 'mention', 'pre'
}:

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

applied

@hejazizo
Copy link
Collaborator

The emojis have been removed as a result of these modifications. More complicated and nested messages are successfully extracted. The project was updated with more stop words, and the user was encouraged to use the Vazir font.

Looks Awesome. Thanks @siniorone.

@hejazizo hejazizo merged commit bca3cd1 into pytopia:main Dec 14, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants