Re: Using NLTK3.0 with Jython
Jeff Allen <[email protected]>
| Newsgroups | gmane.comp.lang.jython.user |
|---|---|
| Message-ID | <[email protected]> |
Monisha:
Yes, the conversation you cite about __defaults__ refers to something
that *is* fixed in 2.7b4. (http://bugs.jython.org/issue2183)
Checking up on your first point, the "as" keyword in an except clause is
a feature of Python from 2.6 onwards. You could replace them all with
commas, but that isn't necessarily the end of your problems.
I checked "as" out in 2.7, and it is definitely supported in Jython 2.7.
I found it behaves oddly when used interactively (at the >>> prompt, no
idea why), but this should not be a problem in NTLK.
Jeff
Jeff Allen
On 13/12/2014 06:32, monisha kanakaraj wrote:
> Hi,
>
> I want to use NLTK 3.0 with Jython.
>
> I have tried Jython2.5.3 and Jython2.7beta3 versions with Pyhton 2.7.3
> version.
>
> when running 'import nltk' in the in the Jython shells i get the
> following errors
>
> 1. Jython2.5.3 with Pyhton 2.7.3 & NLTK 3.0
>
> >>> import sys
> >>> sys.path.append('/usr/local/lib/python2.7/dist-packages/')
> >>> import nltk
> Traceback (most recent call last):
> File "<stdin>", line 1, in <module>
> File "/usr/local/lib/python2.7/dist-packages/nltk/__init__.py", line 35
> except IOError as ex:
> ^
> SyntaxError: mismatched input 'as' expecting COLON
>
>
>
> 2. jython2.7b3 with Pyhton 2.7.3 & NLTK 3.0
>
>
> >>> import sys
> >>> sys.path.append('/usr/local/lib/python2.7/dist-packages/')
> >>> import nltk
> Traceback (most recent call last):
> File "<stdin>", line 1, in <module>
> File "/usr/local/lib/python2.7/dist-packages/nltk/__init__.py", line
> 104, in <module>
> from nltk.decorators import decorator, memoize
> File "/usr/local/lib/python2.7/dist-packages/nltk/decorators.py",
> line 183, in <module>
> @decorator
> File "/usr/local/lib/python2.7/dist-packages/nltk/decorators.py",
> line 172, in decorator
> return update_wrapper(_decorator, caller)
> File "/usr/local/lib/python2.7/dist-packages/nltk/decorators.py",
> line 83, in update_wrapper
> infodict = infodict or getinfo(model)
> File "/usr/local/lib/python2.7/dist-packages/nltk/decorators.py",
> line 76, in getinfo
> return dict(name=func.__name__, argnames=argnames,
> signature=signature,
> AttributeError: 'function' object has no attribute '__defaults__'
>
> I have also gone through the mail thread
> http://sourceforge.net/p/jython/mailman/message/32929832/, where the
> final conclusion i understood is to wait for beta4 release of jython2.7.
>
> My question is can I get any patch to work with jython2.7b3 with
> Pyhton 2.7.3 & NLTK 3.0? If so kindly help me in adding the patch.
>
> Or is there a way to rectify the mismatched input 'as' expecting COLON
> error in Jython2.5.3 with Pyhton 2.7.3 & NLTK 3.0?
>
> Kindly help.
>
> Thanks in advance.
>
>
>
>
>
>
> ------------------------------------------------------------------------------
> Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
> from Actuate! Instantly Supercharge Your Business Reports and Dashboards
> with Interactivity, Sharing, Native Excel Exports, App Integration & more
> Get technology previously reserved for billion-dollar corporations, FREE
> http://pubads.g.doubleclick.net/gampad/clk?id=164703151&iu=/4140/ostg.clktrk
>
>
> _______________________________________________
> Jython-users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/jython-users
------------------------------------------------------------------------------
Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
from Actuate! Instantly Supercharge Your Business Reports and Dashboards
with Interactivity, Sharing, Native Excel Exports, App Integration & more
Get technology previously reserved for billion-dollar corporations, FREE
http://pubads.g.doubleclick.net/gampad/clk?id=164703151&iu=/4140/ostg.clktrk
_______________________________________________
Jython-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jython-users