datulaida 0 Newbie Poster

hi all,
I want to integrate Python 2.5 with JNI class..
Here my code..
actually, i want to integrate Apple Pie Parser (used C++ language) with
Python..
the step is :
1) i build JNI class in Java that integrating with APP

JAVA CODE

import java.text.BreakIterator ; 

class Semantic {

   // native C++ method
   //public native void printMessage( String message );
     public native String printMessage( String message );
   // load library JNIPrintMessage into JVM 
   static {
      System.loadLibrary( "JNIPrintMessage" );
   }


      public static void main(String [] args) {

       String l = "i go to school";
       pilih_ayat(l); 


          }

      public static String pilih_ayat(String n){

            JNIPrintWrapper wrapper = new JNIPrintWrapper(); 

               String ayat_siap =  wrapper.printMessage(n);
            System.out.println("output >>" + ayat_siap);
            return n;
        }//end pilih ayat


      public Semantic(){
          System.out.println ("Berjaya");
      }
}//end class

JAVA OUTPUT

output >> (S(NLP i) (VP go(PP to(NLP school))))

2)now i want to integrate Java code with Python used Jpype (It is possible??)

PYTHON CODE

from jpype import *

startJVM("d:/Program Files/Java/jdk1.6.0/jre/bin/client/jvm.dll","-ea")
jnavClass = JClass("Semantic")

 jnav = jnavClass()

print jnavClass.pilih_ayat("i go to school")

shutdownJVM()

PYTHON OUTPUT

i go to school  

I WANT TO GET PYTHON OUTPUT SAME WITH JAVA OUTPUT.. HOW??
ANY SUGESSTION??

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.