Skip to content

Commit

Permalink
Added adj_freq() to tests
Browse files Browse the repository at this point in the history
  • Loading branch information
vthorsteinsson committed Mar 20, 2019
1 parent 6d7d9b2 commit 9079da5
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions test/test_ngrams.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,17 +96,17 @@ def test_partitioned_list():

def test_trigrams():
n = Ngrams()
assert n.freq('hálfur', 'millimetri', 'að') == 2
assert n.freq("xxx", "yyy", "zzz") == 1
assert n.freq("Hann", "var", "zzz") == 1
assert n.freq('hálfur', 'millimetri', 'að') == 1
assert n.adj_freq("xxx", "yyy", "zzz") == 1
assert n.adj_freq("Hann", "var", "zzz") == 1

assert n.freq("") > 11700000
assert n.freq("", "Hér") > 20200
assert n.freq("Ísland") > 40000
assert n.prob("Ísland") > 0.00039
assert n.logprob("Ísland") > -7.830
assert n.freq("Katrín", "Jakobsdóttir") > 3500
assert n.freq("velta", "fyrirtækisins", "er") >= 5
assert n.adj_freq("velta", "fyrirtækisins", "er") >= 5

assert "Jakobsdóttir" in set(u for u, lp in n.succ(10, "Katrín"))
assert "Gunnarsdóttir" in set(u for u, lp in n.succ(10, "Þorgerður", "Katrín"))
Expand Down

0 comments on commit 9079da5

Please sign in to comment.