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

reserved_words attribute never gets filled, instead an originally undefined attribute reserved is created and filled instead. #55

Open
rsyarif opened this issue Feb 25, 2023 · 1 comment · May be fixed by #56
Labels

Comments

@rsyarif
Copy link

rsyarif commented Feb 25, 2023

Describe the bug

When parsing, reserved_words attribute never gets filled, instead a new originally undefined attr reserved is created and filled instead.

To Reproduce

I printed out the following in processor/parse.py

print('a_parser_method:',a_parser_method)
print('attr:',attr)
print('items:',items)

if one looks at the original attributes, reserved is not defined

parse_res = ParseResult()
[x for x in dir(parse_res) if '__' not in x]
['emojis',
 'hashtags',
 'mentions',
 'numbers',
 'reserved_words',
 'smileys',
 'urls']

but once it goes through the parse function, a new attr reserved attr is created and filled instead of reserved_words

parse_obj = Parse()
[x for x in dir(parse_obj.parse('RT RT')) if '__' not in x] 
a_parser_method: parse_emojis
attr: emojis
items: None
a_parser_method: parse_hashtags
attr: hashtags
items: None
a_parser_method: parse_mentions
attr: mentions
items: None
a_parser_method: parse_numbers
attr: numbers
items: None
a_parser_method: parse_reserved_words
attr: reserved
items: [(0:2) => RT, (3:5) => RT]
a_parser_method: parse_smileys
attr: smileys
items: None
a_parser_method: parse_urls
attr: urls
items: None
['emojis',
 'hashtags',
 'mentions',
 'numbers',
 'reserved',
 'reserved_words',
 'smileys',
 'urls']

This is a harmless bug, but I thought I'd point it out anyway. It was a bit weird to find out that reserved_words always ending up empty no matter what.

@Wambua96
Copy link

Wambua96 commented Apr 8, 2024

Good job

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
2 participants