Skip to content

Commit

Permalink
Kod tekrarı yapma.
Browse files Browse the repository at this point in the history
  • Loading branch information
ahmetaa committed Jan 4, 2019
1 parent a90351a commit ce875a9
Showing 1 changed file with 8 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,19 @@ public class ZemberekSpellCheckTest {

@Test
public void testIncorrectWords1() {
RootLexicon lexicon = RootLexicon.fromLines("okumak", "gitmek [A:Voicing]");
RootLexicon lexicon = getVerbLexicon();
ZemberekSpellChecker instance = ZemberekSpellChecker.getInstance(lexicon);
Assert.assertFalse(instance.isCorrect("okuycam"));
Assert.assertFalse(instance.isCorrect("gidicem"));
}

private RootLexicon getVerbLexicon() {
return RootLexicon.fromLines("okumak", "gitmek [A:Voicing]");
}

@Test
public void testSuggestions1() {
RootLexicon lexicon = RootLexicon.fromLines("okumak", "gitmek [A:Voicing]");
RootLexicon lexicon = getVerbLexicon();
ZemberekSpellChecker instance = ZemberekSpellChecker.getInstance(lexicon);
String[] inputs = {"ou", "ku", "okuu", "oyu"};
for (String input : inputs) {
Expand All @@ -26,15 +30,15 @@ public void testSuggestions1() {

@Test
public void testSplit1() {
RootLexicon lexicon = RootLexicon.fromLines("okumak", "gitmek [A:Voicing]");
RootLexicon lexicon = getVerbLexicon();
ZemberekSpellChecker instance = ZemberekSpellChecker.getInstance(lexicon);
Assert.assertTrue(instance.getSuggestions("okudumgittim").contains("okudum gittim"));
Assert.assertTrue(instance.getSuggestions("giderokuyacak").contains("gider okuyacak"));
}

@Test
public void testInformalWords1() {
RootLexicon lexicon = RootLexicon.fromLines("okumak", "gitmek [A:Voicing]");
RootLexicon lexicon = getVerbLexicon();
ZemberekSpellChecker instance = ZemberekSpellChecker.getInstance(lexicon);
Assert.assertTrue(instance.getSuggestions("okuycam").contains("okuyacağım"));
Assert.assertTrue(instance.getSuggestions("gidicem").contains("gideceğim"));
Expand Down

0 comments on commit ce875a9

Please sign in to comment.