1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
| from jpype import * import jpype.imports addClassPath("/root/Desktop/works/pyjom/tests/karaoke_effects/classpath/lingua.jar") startJVM(getDefaultJVMPath()) java.lang.System.out.println("Calling Java Print from Python using Jpype!") from com.github.pemistahl.lingua.api import *
detector = LanguageDetectorBuilder.fromAllLanguages().build() sample = 'hello world' result = detector.detectLanguageOf(sample) print(result, type(result))
strResult = str(result) print(strResult, type(strResult)) import math print("CALLING MATH: %d" % math.sqrt(4)) shutdownJVM()
|