-
Notifications
You must be signed in to change notification settings - Fork 29
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
a problem with tag() return type #23
Comments
And, if this helps even a bit, here is the execution from the cmd (I'm working on Windows) with TreeTagger and TEST.txt containing "What is the airspeed of an unladen swallow?". C:\TreeTagger>tag-english TEST.txt |
Hi Izgeg, please have a look at the following code fragment.
You can specify a second parameter for the language when instantiating the Does this answer the question? Cheers |
Hi again, I'm sorry if I wasn't clear on what I meant. The problem is pretty simple : I do not get the expected return.
For this code, that you gave in the README, you get the following return :
For this same code that I tested on my computer, I get :
But, the TreeTagger works properly on my computer from the cmd I get what I should get ie, the proper tokenization of the sentence.
So, I believe there might be a problem in the treetagger.py file. If not, I would like to get some of your help for using properly your files. Many thanks again and sorry for my bad english if it's not clear. |
Please try the |
Hi, this is the error I get when I use the branch. I tried some modifications aiming to give you something working under Windows but couldn't make it work. |
I can't help you because I don't have a Windows computer. You could try it under Linux. Installation instructions for Linux in e.g. VirtualBox under Windows can be found on the Internet. |
Same problem for me, also Windows user. Any solution? |
Have you been able to import the TreeTagger program into Python as follows? Have you been able to create a new instance? If so, what is the output of the following command, does the path point to the TreeTagger executable? |
Everything seems to work fine. if i print the result of but when i print the result of the full code is the following
Using command line everything is working! |
Watching at the "tag" function in treetagger.py, seems that the problem is raised by the line |
Apparently the TreeTagger programme must now be executed differently. The code is changed, please test it. You can also run the Python doctest. To do this, set the environment variable in the Windows command line |
Hi, you might recognize the code from your "README", I'm sorry to bother if my question is stupid and I thank you for the work you provided for us.
Here is the code I use ;
from treetagger import TreeTagger
tt = TreeTagger(path_to_treetagger='C:\TreeTagger')
tmp = tt.tag('What is the airspeed of an unladen swallow?')
print(tmp)
with or without the tmp and the print, I get the same return which is "[['Usage: tag-english file {file}']]".
I should get something different, in your example you get a proper answer. I tried some tests and added some prints in the tag function they all go right. I don't understand the problem and I would be grateful if you could help me.
The tt.get_installed_lang() method works just fine and so does the Tree Tagger on his own when I call it with a .txt file.
Many thanks again for your work.
PS: I'm sorry for the many mistakes you will find in this text, english is not my mother tongue.
The text was updated successfully, but these errors were encountered: