Dear Jeff

Thank you very much for your advice. I am sending this as a new message because I can't write replies on Jython-user site, and don't know how I can enable myself to do so.

Anyway, first of all, I am not sure what you mean by \\j. Are you saying that I should indicate the path as, for instance, "stanford-parser-2008\\javadoc"?

I tried adding that jar file but it still didn't work.

The stanford-parser-2008 folder has two directories--javadoc and src, and they have identical sets of folders. Your comments helped me see that javadoc is just a collection of documentations in html format, and the src folder should contain the executable files.

But I did a file search for .class and found that the stanford-parser folder contains no .class file, and just lots of .java files. For instance, it goes like this:

src\edu\stanford\nlp\parser\Parser.java
src\edu\stanford\nlp\parser\lexparser\LexicalizedParser.java

I added the src to the sys.path and tried to import "Parser" with these paths but still got the same error messages.

Is this because I don't have .class files here? Do I need to compile the .java files into .class files first? But I tried that and got error messages. After all, the stanford package is supposed to be complete and ready to run. Could you give me some more help here?

Thanks.



Jeff Emanuel :
First, \j is a control character. You want \\j or /j.
Second, in the answer you cite, you should notice that
Charlie adds the jar file to the path, not the javadoc
directory. It is unlikely for the javadoc directory to
contain any .class files. Add the jar file to the path
as Charlie shows.



Jinseung Eu wrote:
  
Hello!

I am having a trouble using a program called Stanford Parser 1.6.1
(http://www-nlp.stanford.edu/downloads/lex-parser.shtml#Download).
(To unzip this file, you have to unzip it twice).

I renamed the unzipped folder as "stanford-parser-2008" and put it in
the jython 2.2.1 folder and added the path as follows:

  
    
import sys
sys.path.append("stanford-parser-2008\javadoc")

      
        
Then I accessed the following packages within javadoc, and this worked:
  
    
import edu.stanford.nlp.parser.lexparser

      
        
But when I try to access a class within it I get an error:

  
    
import edu.stanford.nlp.parser.lexparser.LexicalizedParser
      
        
Traceback ...
File "<console>"....
ImportError: no module named LexicalizedParser

  
    
from edu.stanford.nlp.parser.lexparser import LexicalizedParser
      
        
Traceback ...
File "<console>"....
ImportError: cannot import name LexicalizedParser

This problem was encountered by someone else two years ago
(http://www.nabble.com/Importing-non-builtin-java-modules-to8957425.html#a8999193)
but does not seem to have received a satisfactory answer.

Could someone please help me get out of this puzzle? I don't know why I
can't import this class while I can import the packages.

Thanks a lot.


To administrator:
Could you please delete the message below with the same title? I tried
the instruction in help and logged into the nabbles page but could not
find any option for deleting my post. Sorry, but web navigation here is
extremely confusing.



  
------------------------------------------------------------------------

------------------------------------------------------------------------------
Apps built with the Adobe(R) Flex(R) framework and Flex Builder(TM) are
powering Web 2.0 with engaging, cross-platform capabilities. Quickly and
easily build your RIAs with Flex Builder, the Eclipse(TM)based development
software that enables intelligent coding and step-through debugging.
Download the free 60 day trial. http://p.sf.net/sfu/www-adobe-com
------------------------------------------------------------------------

_______________________________________________
Jython-users mailing list
Jython-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jython-users