-
Notifications
You must be signed in to change notification settings - Fork 200
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
Nonetype object Not Iterable on using thesaurus #56
Comments
some word‘s equivalences is none but original code have code like “sth in equivalences“, |
I had this problem it seems that self.database_object.get_table_by_name(table_name).equivalences in parser.py:711&806 can be NoneType. You can avoid the bugs by adding these two lines above: if self.database_object.get_table_by_name(table_name).equivalences is None:
continue Why is this variable sometimes NoneType?
|
It solution is interesting .... i'll try it
El 22 may. 2019 2:35 PM, "vlevieux" <notifications@github.com> escribió:
… I had this problem it seems that self.database_object.get_
table_by_name(table_name).equivalences in parser.py:711&806 can be
NoneType.
You can avoid the bugs by adding these two lines above:
if self.database_object.get_table_by_name(table_name).equivalences is None:
continue
Why is this variable sometimes NoneType?
- I have no idea.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#56?email_source=notifications&email_token=AJCKPKIAAH5OSGUBLO3ULXLPWWOADA5CNFSM4G2MUJE2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODWACSNI#issuecomment-494938421>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AJCKPKMAIVHXAV6V7GZORWLPWWOADANCNFSM4G2MUJEQ>
.
--
El contenido de este mensaje y sus anexos son únicamente para el uso del
destinatario y pueden contener información clasificada o reservada. Si
usted no es el destinatario intencional, absténgase de cualquier uso,
difusión, distribución o copia de esta comunicación.
|
It seems to be a problem by reading the thesaurus dictionary. In the paper, they indicated:
Then I tried to get the table chambre when I ask with azertyuiop (random word) to try this feature. Then I added these lines in the thesaurus dictionary:
I ran the following command: python -m ln2sql.main -d database_store/hotel.sql -l lang_store/english.csv -t thesaurus_store\th_english.dat -j output.json -i "What are the azertyuiop with nbLit greater than 3?" The result is: (it's correct) SELECT *
FROM chambre
WHERE chambre.nbLit > '3'; I noticed with the following lines in the thesaurus dictionary doesn't work. You need to add another value as above.
I need to figure out the way they retrieve values. Why does it return NoneType? Why doesn't single synonym work? |
just let the equivalences =[] rather than Nonetype when initialize the database object |
After which line of code(please put the statement) should we place the if condition? |
i tried adding after 709 and 805. However the output seems to be different before and after. Please refer to below screenshot So, Instead of continuing when the self.database_object.get_table_by_name(table_name).equivalences is None, i have tried setting it to empty List. if self.database_object.get_table_by_name(table_name).equivalences is None:
self.database_object.get_table_by_name(table_name).equivalences = [] |
Seems like even the single word works but we have to end it with a pipe as below
instead of
|
Change the first few lines in load method in thesaurus.py file to below:
Now its working even id we dont add an extra pipe at the end |
Hi, I tried to use thesaurus, but I'm getting an issue saying "argument of type 'NoneType' is not iterable".
Could anyone help on this?
Thanks!
The text was updated successfully, but these errors were encountered: