jmccrae/gwn-scala-api

GWN failing tests in European locale

Closed this issue · 1 comments

Hi John,

I attempted to run GWN, but it seems to be failing its integration tests (see below).

Some version info that may be relevant too:

14:51 $ java -version
openjdk version "21.0.3" 2024-04-16
OpenJDK Runtime Environment Homebrew (build 21.0.3)
OpenJDK 64-Bit Server VM Homebrew (build 21.0.3, mixed mode, sharing)
14:48 $ sbt
[info] [launcher] getting org.scala-sbt sbt 1.10.0  (this may take some time)...
[info] [launcher] getting Scala 2.12.19 (for sbt)...
[info] Updated file /Users/rqf595/project/build.properties: set sbt.version to 1.10.0
[info] welcome to sbt 1.10.0 (Homebrew Java 21.0.3)
[info] loading project definition from /Users/rqf595/project
[info] set current project to rqf595 (in build file:/Users/rqf595/)
[info] 
[info] Here are some highlights of sbt 1.10.0:
[info]   - SIP-51 support for Scala 2.13 evolution
[info]   - Various Zinc fixes
[info]   - ConsistentAnalysisFormat: new Zinc Analysis serialization
[info]   - CommandProgress API
[info] See https://eed3si9n.com/sbt-1.10.0 for full release notes.
[info] Hide the banner for this release by running `skipBanner`.
[info] sbt server started at local:///Users/rqf595/.sbt/1.0/server/879447e4e131d7a99a86/sock
[info] started sbt server
sbt:rqf595> 

GWN test fail

14:51 $ ./gwn
[info] welcome to sbt 1.9.2 (Homebrew Java 21.0.3)
[info] loading settings for project gwn-scala-api-master-build from plugins.sbt ...
[info] loading project definition from /Users/rqf595/Downloads/gwn-scala-api-master/project
[info] loading settings for project gwn-scala-api-master from build.sbt ...
[info] set current project to gwn-scala-api-master (in build file:/Users/rqf595/Downloads/gwn-scala-api-master/)
[warn] multiple main classes detected: run 'show discoveredMainClasses' to see the list
[info] Including from cache: jsonld-java-0.5.1.jar
[info] Including from cache: xercesImpl-2.11.0.jar
[info] Including from cache: jena-core-3.0.0.jar
[info] Including from cache: jackson-databind-2.3.3.jar
[info] Including from cache: log4j-1.2.17.jar
[info] Including from cache: spray-json_2.13-1.3.6.jar
[info] Including from cache: httpcore-4.2.5.jar
[info] Including from cache: commons-codec-1.6.jar
[info] Including from cache: scopt_2.13-3.7.1.jar
[info] Including from cache: slf4j-api-1.7.12.jar
[info] Including from cache: jena-iri-3.0.0.jar
[info] Including from cache: commons-cli-1.3.jar
[info] Including from cache: slf4j-log4j12-1.7.12.jar
[info] Including from cache: commons-lang3-3.4.jar
[info] Including from cache: jena-arq-3.0.0.jar
[info] Including from cache: httpclient-cache-4.2.6.jar
[info] Including from cache: commons-csv-1.0.jar
[info] Including from cache: scala-library-2.13.11.jar
[info] Including from cache: jackson-core-2.3.3.jar
[info] Including from cache: jackson-annotations-2.3.0.jar
[info] Including from cache: commons-logging-1.1.1.jar
[info] Including from cache: libthrift-0.9.2.jar
[info] Including from cache: jena-base-3.0.0.jar
[info] Including from cache: xml-apis-1.4.01.jar
[info] Including from cache: httpclient-4.2.6.jar
[info] Including from cache: scala-xml_2.13-1.2.0.jar
[info] Including from cache: jena-shaded-guava-3.0.0.jar
Mandatory property @id is missing, defaulting to "nld"
Synset[wn30-02121620-n](i46593)Error Count: 0

Synset[wn31-02124272-n](i46593, hypernym -> wn31-02124272-n)
0 [pool-5-thread-10-ScalaTest-running-W3CSpec] DEBUG org.apache.jena.riot.system.stream.JenaIOEnvironment  - Failed to find configuration: location-mapping.ttl;location-mapping.rdf;location-mapping.n3;etc/location-mapping.rdf;etc/location-mapping.n3;etc/location-mapping.ttl
0 [pool-5-thread-10-ScalaTest-running-W3CSpec] DEBUG org.apache.jena.riot.system.stream.JenaIOEnvironment  - Failed to find configuration: location-mapping.ttl;location-mapping.rdf;location-mapping.n3;etc/location-mapping.rdf;etc/location-mapping.n3;etc/location-mapping.ttl
LexName not found: none
LexName not found: nonester / Test / executeTests 1s
LexName not found: none
[http://www.w3.org/2006/03/wn/wn20/instances/wordsense-stretching-noun-1, http://www.w3.org/2006/03/wn/wn20/schema/word, http://www.w3.org/2006/03/wn/wn20/instances/word-stretching]
[http://www.w3.org/2006/03/wn/wn20/instances/wordsense-stretching-noun-1, http://www.w3.org/2006/03/wn/wn20/schema/tagCount, "1"@en-US]
[http://www.w3.org/2006/03/wn/wn20/instances/wordsense-stretching-noun-1, http://www.w3.org/2000/01/rdf-schema#label, "stretching"@en-US]
[http://www.w3.org/2006/03/wn/wn20/instances/wordsense-stretching-noun-1, http://www.w3.org/1999/02/22-rdf-syntax-ns#type, http://www.w3.org/2006/03/wn/wn20/schema/NounWordSense]
[http://www.w3.org/2006/03/wn/wn20/instances/wordsense-stretching-noun-1, http://www.w3.org/2006/03/wn/wn20/schema/derivationallyRelated, http://www.w3.org/2006/03/wn/wn20/instances/wordsense-stretch-verb-2]
[http://www.w3.org/2006/03/wn/wn20/instances/wordsense-grandfather-noun-1, http://www.w3.org/2006/03/wn/wn20/schema/word, http://www.w3.org/2006/03/wn/wn20/instances/word-grandfather]
[http://www.w3.org/2006/03/wn/wn20/instances/wordsense-grandfather-noun-1, http://www.w3.org/2006/03/wn/wn20/schema/tagCount, "4"@en-US]
[http://www.w3.org/2006/03/wn/wn20/instances/wordsense-grandfather-noun-1, http://www.w3.org/2000/01/rdf-schema#label, "grandfather"@en-US]
[http://www.w3.org/2006/03/wn/wn20/instances/wordsense-grandfather-noun-1, http://www.w3.org/1999/02/22-rdf-syntax-ns#type, http://www.w3.org/2006/03/wn/wn20/schema/NounWordSense]
[http://www.w3.org/2006/03/wn/wn20/instances/wordsense-stretch-verb-2, http://www.w3.org/2006/03/wn/wn20/schema/word, http://www.w3.org/2006/03/wn/wn20/instances/word-stretch]
[http://www.w3.org/2006/03/wn/wn20/instances/wordsense-stretch-verb-2, http://www.w3.org/2006/03/wn/wn20/schema/tagCount, "11"@en-US]
[http://www.w3.org/2006/03/wn/wn20/instances/wordsense-stretch-verb-2, http://www.w3.org/2000/01/rdf-schema#label, "stretch"@en-US]
[http://www.w3.org/2006/03/wn/wn20/instances/wordsense-stretch-verb-2, http://www.w3.org/1999/02/22-rdf-syntax-ns#type, http://www.w3.org/2006/03/wn/wn20/schema/VerbWordSense]
[http://www.w3.org/2006/03/wn/wn20/instances/wordsense-stretch-verb-2, http://www.w3.org/2006/03/wn/wn20/schema/frame, "Somebody ----s"@en-US]
[info] DebVisDicSpec:
[info] DebVisDic reader
[info] - should successfully read a DebVisDic file
[info] - should produce 1 lexicon
[info] - should contain entry poidza
[info] - should contain synset ENG20-00017381-a
[info] - should roundtrip
[info] JsonSpec:
[info] Json reader
[info] - should successfully read a JSON file
[info] - should produce 2 lexicons
[info] - should get features of lexicon
[info] - should produce 3 english entries
[info] - should produce 2 synset
[info] - should produce an entry for grandfather
[info] - should produce a sense
[info] - should produce a sense relation
[info] - should produce syntactic behavior
[info] - should produce a synset
[info] JSON Writer
[info] - should write a file
[info] - should roundtrip
[info] MergeTest:
[info] merge
[info] - should join two lexicons
[info] OMWNLMFSpec:
[info] OMWN LMF reader
[info] - should successfully read an XML file
[info] - should produce 2 lexicon
[info] - should have 1 lexical entry
[info] - should have 5 synsets
[info] - should have read a synset correctly
[info] - should have read an entry correctly
[info] - should have an ID
[info] OMWNSpec:
[info] OMWN
[info] - should read a file
[info] CoverageTest:
[info] XML reader
[info] - should read the coverage xml
[info] - should provide coverage
[info] - should write the coverage model
[info] - should successfully read the same data *** FAILED ***
[info]   java.lang.NumberFormatException: For input string: "1,00000000"
[info]   at java.base/jdk.internal.math.FloatingDecimal.readJavaFormatString(FloatingDecimal.java:2054)
[info]   at java.base/jdk.internal.math.FloatingDecimal.parseDouble(FloatingDecimal.java:110)
[info]   at java.base/java.lang.Double.parseDouble(Double.java:792)
[info]   at scala.collection.StringOps$.toDouble$extension(StringOps.scala:951)
[info]   at org.globalwordnet.api.serialize.WNLMF.$anonfun$readMeta$31(xml.scala:192)
[info]   at org.globalwordnet.api.serialize.WNLMF.$anonfun$readMeta$31$adapted(xml.scala:192)
[info]   at scala.collection.IterableOnceOps.foreach(IterableOnce.scala:576)
[info]   at scala.collection.IterableOnceOps.foreach$(IterableOnce.scala:574)
[info]   at scala.collection.AbstractIterable.foreach(Iterable.scala:933)
[info]   at org.globalwordnet.api.serialize.WNLMF.readMeta(xml.scala:192)
[info]   ...
[info] JSON reader
[info] - should write the coverage model
[info] - should successfully read the same data *** FAILED ***
[info]   java.lang.NumberFormatException: Character , is neither a decimal digit number, decimal point, nor "e" notation exponential mark.
[info]   at java.base/java.math.BigDecimal.<init>(BigDecimal.java:608)
[info]   at java.base/java.math.BigDecimal.<init>(BigDecimal.java:497)
[info]   at java.base/java.math.BigDecimal.<init>(BigDecimal.java:903)
[info]   at scala.math.BigDecimal$.exact(BigDecimal.scala:124)
[info]   at scala.math.BigDecimal$.apply(BigDecimal.scala:247)
[info]   at org.globalwordnet.api.serialize.WNJSON$WNJSONFormat$.numberOrFail(json.scala:162)
[info]   at org.globalwordnet.api.serialize.WNJSON$WNJSONFormat$MetaFormat.$anonfun$read$17(json.scala:149)
[info]   at scala.Option.map(Option.scala:242)
[info]   at org.globalwordnet.api.serialize.WNJSON$WNJSONFormat$MetaFormat.read(json.scala:149)
[info]   at org.globalwordnet.api.serialize.WNJSON$WNJSONFormat$senseFormat$.$anonfun$read$40(json.scala:317)
[info]   ...
[info] RDF reader
[info] - should write the coverage model
[info] - should successfully read the same data
[info] XMLSpec:
[info] XML reader
[info] - should successfully read an XML file
[info] - should produce 2 lexicons
[info] - should get features of lexicon
[info] - should produce 3 english entries
[info] - should produce 3 synset
[info] - should produce an entry for grandfather
[info] - should produce a sense
[info] - should produce a sense relation
[info] - should produce syntactic behavior
[info] - should produce a synset
[info] XML Writer
[info] - should write a file
[info] - should roundtrip *** FAILED ***
[info]   "..." confidenceScore="1[,00000000"> <LexicalEntry id="w1"> <Lemma writtenForm="grandfather" partOfSpeech="n"/> <Sense id="example-en-10161911-n-1" synset="example-en-10161911-n"/> </LexicalEntry> <LexicalEntry id="w2"> <Lemma writtenForm="paternal grandfather" partOfSpeech="n"/> <Sense id="example-en-1-n-1" synset="example-en-1-n"> <SenseRelation relType="derivation" target="example-en-10161911-n-1"/> </Sense> </LexicalEntry> <LexicalEntry id="w3"> <Lemma writtenForm="pay" partOfSpeech="v"/> <SyntacticBehaviour subcategorizationFrame="Sam cannot %s Sue "/> <SyntacticBehaviour subcategorizationFrame="Sam and Sue %s"/> <SyntacticBehaviour subcategorizationFrame="The banks %s the check"/> </LexicalEntry> <Synset id="example-en-10161911-n" ili="i90287" partOfSpeech="n"> <Definition>the father of your father or mother</Definition> <SynsetRelation relType="hypernym" target="example-en-10162692-n"/> </Synset> <Synset id="example-en-1-n" ili="in" partOfSpeech="n"> <Definition>A father&apos;s father; a paternal grandfather</Definition> <ILIDefinition dc:source="https://en.wiktionary.org/wiki/farfar">A father&apos;s father; a paternal grandfather</ILIDefinition> </Synset> <Synset id="example-en-10162692-n" ili="i90292" partOfSpeech="n"> </Synset> </Lexicon> <Lexicon id="example-sv" label="Example wordnet (Swedish)" language="sv" email="john@mccr.ae" license="https://creativecommons.org/publicdomain/zero/1.0/" version="1.0" citation="CILI: the Collaborative Interlingual Index. Francis Bond, Piek Vossen, John P. McCrae and Christiane Fellbaum, Proceedings of the Global WordNet Conference 2016, (2016)." url="http://globalwordnet.github.io/schemas/" dc:publisher="Global Wordnet Association" confidenceScore="1,]00000000"> <LexicalE..." was not equal to "..." confidenceScore="1[.00000000"> <LexicalEntry id="w1"> <Lemma writtenForm="grandfather" partOfSpeech="n"/> <Sense id="example-en-10161911-n-1" synset="example-en-10161911-n"/> </LexicalEntry> <LexicalEntry id="w2"> <Lemma writtenForm="paternal grandfather" partOfSpeech="n"/> <Sense id="example-en-1-n-1" synset="example-en-1-n"> <SenseRelation relType="derivation" target="example-en-10161911-n-1"/> </Sense> </LexicalEntry> <LexicalEntry id="w3"> <Lemma writtenForm="pay" partOfSpeech="v"/> <SyntacticBehaviour subcategorizationFrame="Sam cannot %s Sue "/> <SyntacticBehaviour subcategorizationFrame="Sam and Sue %s"/> <SyntacticBehaviour subcategorizationFrame="The banks %s the check"/> </LexicalEntry> <Synset id="example-en-10161911-n" ili="i90287" partOfSpeech="n"> <Definition>the father of your father or mother</Definition> <SynsetRelation relType="hypernym" target="example-en-10162692-n"/> </Synset> <Synset id="example-en-1-n" ili="in" partOfSpeech="n"> <Definition>A father&apos;s father; a paternal grandfather</Definition> <ILIDefinition dc:source="https://en.wiktionary.org/wiki/farfar">A father&apos;s father; a paternal grandfather</ILIDefinition> </Synset> <Synset id="example-en-10162692-n" ili="i90292" partOfSpeech="n"> </Synset> </Lexicon> <Lexicon id="example-sv" label="Example wordnet (Swedish)" language="sv" email="john@mccr.ae" license="https://creativecommons.org/publicdomain/zero/1.0/" version="1.0" citation="CILI: the Collaborative Interlingual Index. Francis Bond, Piek Vossen, John P. McCrae and Christiane Fellbaum, Proceedings of the Global WordNet Conference 2016, (2016)." url="http://globalwordnet.github.io/schemas/" dc:publisher="Global Wordnet Association" confidenceScore="1.]00000000"> <LexicalE..." (test_xml.scala:72)
[info] PLWNTest:
[info] plWordNet Reader
[info] - should read the test file
[info] W3CSpec:
[info] RDF reader
[info] - should successfully read an RDF file
[info] - should produce 1 lexicons
[info] - should get features of lexicon
[info] - should produce 2 english entries
[info] - should produce 2 synset
[info] - should produce an entry for grandfather
[info] - should produce a sense
[info] - should produce a sense relation
[info] - should produce syntactic behavior
[info] - should produce a synset
[info] WNDBSpec:
[info] - should output a correct data.noun file
[info] - should output a correct index.noun file
[info] - should output a correct index.sense
[info] RDFSpec:
[info] RDF reader
[info] - should successfully read an RDF file
[info] - should produce 2 lexicons
[info] - should get features of lexicon
[info] - should produce 3 english entries
[info] - should produce 2 synset
[info] - should produce an entry for grandfather
[info] - should produce a sense
[info] - should produce a sense relation
[info] - should produce syntactic behavior
[info] - should produce a synset
[info] RDF Writer
[info] - should write a file
[info] - should use isLexicalizedSenseOf
[info] - should use SKOS namespace
[info] roundtripping
[info] - should work
[info] - should produce 2 lexicons
[info] - should get features of lexicon
[info] - should produce 3 english entries
[info] - should produce 2 synset
[info] - should produce an entry for grandfather
[info] - should produce a sense
[info] - should produce a sense relation
[info] - should produce syntactic behavior
[info] - should produce a synset
[info] - should produce short relations
[info] Run completed in 811 milliseconds.
[info] Total number of tests run: 84
[info] Suites: completed 11, aborted 0
[info] Tests: succeeded 81, failed 3, canceled 0, ignored 0, pending 0
[info] *** 3 TESTS FAILED ***
[error] Failed tests:
[error] 	org.globalwordnet.api.serialize.CoverageTest
[error] 	org.globalwordnet.api.serialize.XMLSpec
[error] (Test / test) sbt.TestsFailedException: Tests unsuccessful
[error] Total time: 4 s, completed 22. maj 2024 14.51.42
/Users/rqf595/Downloads/gwn-scala-api-master
Error: Unable to access jarfile ./target/scala-2.13/gwn-scala-api-assembly-0.2.jar

Actually, the tests pass and a verified by the continuous integration.

It seems that this is a locale issue, looking at the issue, the API has serialized some numbers as 1,0000 with a European comma as the decimal separator.

I will see if I can reproduce