Skip to content

Commit

Permalink
fix equals() for WordReading
Browse files Browse the repository at this point in the history
  • Loading branch information
arysin committed Oct 14, 2023
1 parent 81adffd commit d672412
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 4 deletions.
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@ ltVersion=6.3
ltUkVersion=6.3
#ltUkVersion=6.2-SNAPSHOT
#morfologik_ukrainian_lt_version=6.1.5
groovyVersion=4.0.12
groovyVersion=4.0.15
# nlp_uk version
version=3.2.3
4 changes: 2 additions & 2 deletions src/main/groovy/ua/net/nlp/bruk/WordReading.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ import groovy.transform.CompileStatic
@CompileStatic
@Canonical
class WordReading {
public String lemma
public String postag
String lemma
String postag

@CompileStatic
WordReading(String lemma, String postag) {
Expand Down
12 changes: 12 additions & 0 deletions src/test/groovy/ua/net/nlp/tools/TagTextDisambigTest.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
package ua.net.nlp.tools

import static org.junit.jupiter.api.Assertions.assertEquals
import static org.junit.jupiter.api.Assertions.assertFalse
import static org.junit.jupiter.api.Assertions.assertNotEquals
import static org.junit.jupiter.api.Assumptions.assumeTrue

import org.checkerframework.framework.qual.IgnoreInWholeProgramInference
Expand All @@ -11,6 +13,9 @@ import org.junit.jupiter.api.BeforeEach
import org.junit.jupiter.api.Disabled
import org.junit.jupiter.api.Test

import groovy.transform.CompileDynamic
import groovy.transform.CompileStatic
import ua.net.nlp.bruk.WordReading
import ua.net.nlp.tools.tag.TagOptions
import ua.net.nlp.tools.tag.TagTextCore
import ua.net.nlp.tools.tag.TagTextCore.TagResult
Expand Down Expand Up @@ -39,6 +44,13 @@ class TagTextDisambigTest {
tagText.setOptions(options)
}

@CompileStatic
@Test
public void testTokenReading() {
def wr1 = new WordReading('а', 'part')
def wr2 = new WordReading('а', 'conj')
assertNotEquals(wr1, wr2)
}

@Test
public void testTokenFormat() {
Expand Down
2 changes: 1 addition & 1 deletion src/test/groovy/ua/net/nlp/tools/tag/TagUnknownTest.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,7 @@ public class TagTextUnknownTest {

expected =
"""<sentence>
<token value="популяється" lemma="популятися" tags="verb:rev:imperf:pres:s:3" q="-0.6" />
<token value="популяється" lemma="популятися" tags="verb:rev:imperf:pres:s:3" q="-0.5" />
</sentence>
<paragraph/>
"""
Expand Down

0 comments on commit d672412

Please sign in to comment.