Comments (9)
some word‘s equivalences is none but original code have code like “sth in equivalences“,
so you just need to add a condition to ensure this part code doesnt execute when equivalence is none
from ln2sql.
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.
from ln2sql.
from ln2sql.
It seems to be a problem by reading the thesaurus dictionary. In the paper, they indicated:
Ainsi si la table regroupant les informations des étudiants a par exemple pour nom ETUD_UNIV_01, et qu'aucun synonyme n'a donc été automatiquement ajouté à ce nom de table, l'utilisateur pourra rentrer manuellement le mot étudiant comme synonyme [...].
Thus, if the table containing the students' information has, for example, the name ETUD_UNIV_01, and no synonyms have been automatically added to this table name, the user can manually enter the word student as a synonym [...].
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:
chambre|1
(noun)|azertyuiop|randomword
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.
chambre|1
(noun)|azertyuiop
I need to figure out the way they retrieve values. Why does it return NoneType? Why doesn't single synonym work?
from ln2sql.
just let the equivalences =[] rather than Nonetype when initialize the database object
from ln2sql.
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: continueWhy is this variable sometimes NoneType?
- I have no idea.
After which line of code(please put the statement) should we place the if condition?
from ln2sql.
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: continueWhy is this variable sometimes NoneType?
- I have no idea.
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 = []
from ln2sql.
It seems to be a problem by reading the thesaurus dictionary. In the paper, they indicated:
Ainsi si la table regroupant les informations des étudiants a par exemple pour nom ETUD_UNIV_01, et qu'aucun synonyme n'a donc été automatiquement ajouté à ce nom de table, l'utilisateur pourra rentrer manuellement le mot étudiant comme synonyme [...].
Thus, if the table containing the students' information has, for example, the name ETUD_UNIV_01, and no synonyms have been automatically added to this table name, the user can manually enter the word student as a synonym [...].
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:
chambre|1 (noun)|azertyuiop|randomword
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.
chambre|1 (noun)|azertyuiop
I need to figure out the way they retrieve values. Why does it return NoneType? Why doesn't single synonym work?
Seems like even the single word works but we have to end it with a pipe as below
chambre|1
(noun)|azertyuiop|
instead of
chambre|1
(noun)|azertyuiop
from ln2sql.
It seems to be a problem by reading the thesaurus dictionary. In the paper, they indicated:
Ainsi si la table regroupant les informations des étudiants a par exemple pour nom ETUD_UNIV_01, et qu'aucun synonyme n'a donc été automatiquement ajouté à ce nom de table, l'utilisateur pourra rentrer manuellement le mot étudiant comme synonyme [...].
Thus, if the table containing the students' information has, for example, the name ETUD_UNIV_01, and no synonyms have been automatically added to this table name, the user can manually enter the word student as a synonym [...].
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:
chambre|1 (noun)|azertyuiop|randomword
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.
chambre|1 (noun)|azertyuiop
I need to figure out the way they retrieve values. Why does it return NoneType? Why doesn't single synonym work?
Change the first few lines in load method in thesaurus.py file to below:
def load(self, path):
with open(self._generate_path(path)) as f:
# content = f.readlines()
content = f.read().splitlines()
Now its working even id we dont add an extra pipe at the end
ref: https://stackoverflow.com/questions/12330522/how-to-read-a-file-without-newlines
from ln2sql.
Related Issues (20)
- Join between tables HOT 1
- Use timestamp column in where clause
- Parent module '' not loaded HOT 1
- Not working to perform joins HOT 3
- Question about accuracy/efficiency HOT 1
- need help
- Inconsistant generated SQL Statement HOT 1
- pip3 package doesn't work HOT 1
- 'NoneType' object has no attribute 'group' HOT 2
- Stopword filtering doesn't work.
- Steps to use ln2sql HOT 5
- how to use Thesaurus
- Multiple Group by
- Caveat Empetor: Postgresql
- Default column for table
- Spanish language.
- case sensitive issue how to solve it
- Limitations of this projects + Some example tests HOT 1
- find a bug
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ln2sql.