Xponents icon indicating copy to clipboard operation
Xponents copied to clipboard

Jython 2.7 support

Open mubaldino opened this issue 5 years ago • 1 comments

Type of Feature: [ ] Collaboration or partnership [ ] Improvement or clarification [ X ] New Processing

Description of Feature

use Jython 2.7 for basic usage of API

mubaldino avatar Aug 08 '19 02:08 mubaldino

Proof of concept: Download = jython.org Learn: https://wiki.python.org/jython/LearningJython

configure, after Jython install, run from Xponents build:

export JAVA_OPTIONS="-Xmx2g -Xms2g -Dopensextant.solr=./solr/solr7"
export CLASSPATH=./dist/Xponents-3.2/etc:./dist/Xponents-3.2/lib/*

Run:

  • jython27/bin/jython

Example integration:


from org.opensextant.extractors.xcoord import XCoord
x =  XCoord(True)

matches = x.extract("dummy test at 38SMB4611036560 looks bad, bad.")
print(matches)
[38SMB4611036560 @(14:29) matched by MGRS-01]

for m in matches:
    print( m.text, m.pattern_id, m.getLatitude() ) 

(u'38SMB4611036560', u'MGRS-01', 32.86583444516076)

mubaldino avatar Aug 08 '19 02:08 mubaldino