-
Notifications
You must be signed in to change notification settings - Fork 428
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* add kotlin and kotlin-test libraries, update github action's plugins
- Loading branch information
Showing
4 changed files
with
65 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
32 changes: 32 additions & 0 deletions
32
grobid-core/src/test/kotlin/org/grobid/core/utilities/SentenceUtilitiesKTest.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
package org.grobid.core.utilities | ||
|
||
import org.junit.Test | ||
import kotlin.test.assertFalse | ||
import kotlin.test.assertTrue | ||
|
||
class SentenceUtilitiesKTest { | ||
|
||
@Test | ||
fun testToSkipToken_shouldReturnTrue() { | ||
val tokens = arrayOf("-", " ", "\n", "\t") | ||
|
||
tokens.forEach { token -> | ||
assertTrue(SentenceUtilities.toSkipToken(token)) | ||
} | ||
|
||
} | ||
|
||
@Test | ||
fun testToSkipTokenNoHypen_shouldReturnTrue() { | ||
val tokens = arrayOf(" ", "\n", "\t") | ||
|
||
tokens.forEach { token -> | ||
assertTrue(SentenceUtilities.toSkipTokenNoHyphen(token)) | ||
} | ||
|
||
assertFalse { SentenceUtilities.toSkipTokenNoHyphen("-") } | ||
|
||
} | ||
|
||
|
||
} |