Skip to content

Commit

Permalink
rm "slow" from the method name
Browse files Browse the repository at this point in the history
  • Loading branch information
mh-northlander committed Dec 3, 2024
1 parent e5bdab3 commit c99fa52
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion src/main/java/com/worksap/nlp/sudachi/Dictionary.java
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ public interface Dictionary extends AutoCloseable {
* 0/length of their headword.
* @see Dictionary#lookup(CharSequence)
*/
public List<Morpheme> slowLookupAllEntries(CharSequence surface);
public List<Morpheme> lookupAllEntries(CharSequence surface);

/**
* Create an out-of-vocabulary morpheme from the pos id and string forms.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ public List<Morpheme> lookup(CharSequence surface) {
}

@Override
public List<Morpheme> slowLookupAllEntries(CharSequence surface) {
public List<Morpheme> lookupAllEntries(CharSequence surface) {
TextNormalizer textNormalizer = textNormalizer();
byte[] bytes = textNormalizer.normalizedInputText(surface).getByteText();

Expand Down
12 changes: 6 additions & 6 deletions src/test/java/com/worksap/nlp/sudachi/JapaneseDictionaryTest.kt
Original file line number Diff line number Diff line change
Expand Up @@ -204,31 +204,31 @@ abc,1,1,4675,AbC,名詞,普通名詞,一般,*,*,*,エービーシー,,,,,""")
@Test
fun slowLookup() {
// nothing
val nothing = dict.slowLookupAllEntries("存在しない語")
val nothing = dict.lookupAllEntries("存在しない語")
assertTrue(nothing.isEmpty())

// system
val tokyo = dict.slowLookupAllEntries("東京都")
val tokyo = dict.lookupAllEntries("東京都")
assertEquals(1, tokyo.size)
assertEquals("トウキョウト", tokyo[0].readingForm())

// user
val sudachi = TestDictionary.user1().slowLookupAllEntries("すだち")
val sudachi = TestDictionary.user1().lookupAllEntries("すだち")
assertEquals(1, sudachi.size)
assertEquals("徳島県産", sudachi[0].getUserData())

// CAN find entry with -1 conjunction cost
val hidden = dict.slowLookupAllEntries("隠し")
val hidden = dict.lookupAllEntries("隠し")
assertEquals(1, hidden.size)
assertEquals("隠し", hidden[0].surface())

// will be normalized
val norm = dict.slowLookupAllEntries("特A")
val norm = dict.lookupAllEntries("特A")
assertEquals(1, norm.size)
assertEquals("特A", norm[0].normalizedForm())

// inputTextPlugin
val yomi = dict.slowLookupAllEntries("京都(キョウト)")
val yomi = dict.lookupAllEntries("京都(キョウト)")
assertEquals(1, yomi.size)
assertEquals("京都", yomi[0].normalizedForm())
}
Expand Down

0 comments on commit c99fa52

Please sign in to comment.