Skip to content

Commit

Permalink
Merge branch 'main' into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
neelsmith authored May 8, 2023
2 parents 00b63ce + 0335542 commit 8f30b5b
Show file tree
Hide file tree
Showing 25 changed files with 56 additions and 51 deletions.
4 changes: 3 additions & 1 deletion Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ uuid = "107500f9-53d4-4696-8485-0747242ad8bc"
authors = ["nsmith"]
version = "0.16.3"


[deps]
AtticGreek = "330c8319-f7ed-461a-8c52-cee5da4c0892"
BenchmarkTools = "6e4b80f9-dd63-53aa-95a3-0cdb28fa8baf"
Expand Down Expand Up @@ -31,7 +32,7 @@ Unicode = "4ec0a83e-493e-50e2-b9ac-8f72acf5a8f5"
[compat]
AtticGreek = "0.8"
BenchmarkTools = "1.3"
CSV = "0.10"
CSV = "0.9, 0.10"
CitableBase = "10"
CitableCorpus = "0.13"
CitableObject = "0.15"
Expand All @@ -45,6 +46,7 @@ Glob = "1"
HTTP = "1"
Orthography = "0.18"
PolytonicGreek = "0.18"

Query = "1"
SplitApplyCombine = "1"
TestSetExtensions = "2"
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ A julia package implementing the kanónes system for building Greek morphologica

Kanones includes an extensive suite of unit tests that take some time to run. To run all of all them, just use the standard `test` command from package mode (and be prepared to wait).

If you want to run a selection of tests, you can do that from the `tests` directory by running `julia select_tests.jl [FILENAMES]`. `select_tests.jl` uses the `TestSetExtensions.jl` package; if you prefer its reporting format, you can run all the tests with `julia select_tests.jl test* */test*jl`.
If you want to run a selection of tests, you can do that from the `tests` directory by running `julia select_tests.jl [FILENAMES]`. `select_tests.jl` uses the `TestSetExtensions.jl` package; if you prefer its reporting format, you can run all the tests with `julia select_tests.jl test* */test*jl`.
2 changes: 1 addition & 1 deletion test/forms/test_adjectives.jl
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
@test adj == gmfAdjective(adjurn)

# round-trip a FormUrn
abbrurn = formurn(adj)
abbrurn = Kanones.formurn(adj)
expectedabbr = FormUrn("forms.7030002410")
@test abbrurn == expectedabbr
@test adj == gmfAdjective(abbrurn)
Expand Down
2 changes: 1 addition & 1 deletion test/forms/test_adverbs.jl
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
@test adv == gmfAdverb(advurn)


abbrurn = formurn(adv)
abbrurn = Kanones.formurn(adv)
expectedabbr = FormUrn("forms.8000000020")
@test abbrurn == expectedabbr
@test adv == gmfAdverb(abbrurn)
Expand Down
2 changes: 1 addition & 1 deletion test/forms/test_finiteverbs.jl
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
@test verburn == expectedurn
@test gmfFiniteVerb(verburn) == verb

abbrurn = formurn(verb)
abbrurn = Kanones.formurn(verb)
expectedabbr = FormUrn("forms.3323110000")
@test abbrurn == expectedabbr
@test gmfFiniteVerb(abbrurn) == verb
Expand Down
2 changes: 1 addition & 1 deletion test/forms/test_infinitives.jl
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
@test infurn == expectedurn
@test inf == gmfInfinitive(infurn)

abbrurn = formurn(inf)
abbrurn = Kanones.formurn(inf)
expectedabbr = FormUrn("forms.4003030000")
@test abbrurn == expectedabbr
@test inf == gmfInfinitive(abbrurn)
Expand Down
2 changes: 1 addition & 1 deletion test/forms/test_nouns.jl
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
@test nounurn == expectedurn
@test noun == gmfNoun(nounurn)

abbrurn = formurn(noun)
abbrurn = Kanones.formurn(noun)
expectedabbr = FormUrn("forms.2010002400")
@test abbrurn == expectedabbr
@test noun == gmfNoun(abbrurn)
Expand Down
2 changes: 1 addition & 1 deletion test/forms/test_participles.jl
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
@test ptcplurn == expectedurn
@test ptcpl == gmfParticiple(ptcplurn)

abbrurn = formurn(ptcpl)
abbrurn = Kanones.formurn(ptcpl)
expectedabbr = FormUrn("forms.5013022400")
@test abbrurn == expectedabbr
@test ptcpl == gmfParticiple(abbrurn)
Expand Down
2 changes: 1 addition & 1 deletion test/forms/test_pronouns.jl
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
@test pronounurn == expectedurn
@test pronoun == gmfPronoun(pronounurn)

abbrurn = formurn(pronoun)
abbrurn = Kanones.formurn(pronoun)
expectedabbr = FormUrn("forms.9010002400")
@test abbrurn == expectedabbr
@test pronoun == gmfPronoun(abbrurn)
Expand Down
2 changes: 1 addition & 1 deletion test/forms/test_uninflected.jl
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
@test uninfl == gmfUninflected(uninflurn)


abbrurn = formurn(uninfl)
abbrurn = Kanones.formurn(uninfl)
expectedabbr = FormUrn("forms.1000000002")
@test abbrurn == expectedabbr
@test uninfl == gmfUninflected(abbrurn)
Expand Down
2 changes: 1 addition & 1 deletion test/forms/test_verbaladjs.jl
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
@test vadjurn == expectedurn
@test vadj == gmfVerbalAdjective(vadjurn)

abbrurn = formurn(vadj)
abbrurn = Kanones.formurn(vadj)
expectedabbr = FormUrn("forms.6010003400")
@test abbrurn == expectedabbr
@test vadj == gmfVerbalAdjective(vadjurn)
Expand Down
2 changes: 1 addition & 1 deletion test/principalparts/test_augment.jl
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
kds = [joinpath(repo,"datasets","literarygreek-rules"), joinpath(repo, "datasets","lsj-vocab") ] |> dataset

αθετεω = LexemeUrn("lsj.n1965")
aorind = GMFFiniteVerb(gmpPerson(1), gmpNumber(1), gmpTense("aorist"), gmpMood(1), gmpVoice(1)) |> formurn
aorind = GMFFiniteVerb(gmpPerson(1), gmpNumber(1), gmpTense("aorist"), gmpMood(1), gmpVoice(1)) |> Kanones.formurn

@test_broken "" == generate(αθετεω, aorind, kds)
end
56 changes: 28 additions & 28 deletions test/principalparts/test_compoundverbs.jl
Original file line number Diff line number Diff line change
Expand Up @@ -29,50 +29,50 @@ end
kds = joinpath(repo, "datasets", "literarygreek-rules") |> dataset
compound = LexemeUrn("lsj.n30252")

pres = GMFFiniteVerb(gmpPerson(1), gmpNumber(1), gmpTense(1), gmpMood(1), gmpVoice(1)) |> formurn
pres = GMFFiniteVerb(gmpPerson(1), gmpNumber(1), gmpTense(1), gmpMood(1), gmpVoice(1)) |> Kanones.formurn
presform = generate(compound, pres, kds)[1]
@test presform == knormal("ἐγκελεύω")


impft = GMFFiniteVerb(gmpPerson(1), gmpNumber(1), gmpTense("imperfect"), gmpMood(1), gmpVoice(1)) |> formurn
impft = GMFFiniteVerb(gmpPerson(1), gmpNumber(1), gmpTense("imperfect"), gmpMood(1), gmpVoice(1)) |> Kanones.formurn
impftform = generate(compound, impft, kds)[1]
@test impftform == knormal("ἐνεκέλευον")


fut = GMFFiniteVerb(gmpPerson(1), gmpNumber(1), gmpTense("future"), gmpMood(1), gmpVoice(1)) |> formurn
fut = GMFFiniteVerb(gmpPerson(1), gmpNumber(1), gmpTense("future"), gmpMood(1), gmpVoice(1)) |> Kanones.formurn
futform = generate(compound, fut, kds)[1]
@test futform == knormal("ἐγκελεύσω")


aorind = GMFFiniteVerb(gmpPerson(1), gmpNumber(1), gmpTense("aorist"), gmpMood(1), gmpVoice(1)) |> formurn
aorind = GMFFiniteVerb(gmpPerson(1), gmpNumber(1), gmpTense("aorist"), gmpMood(1), gmpVoice(1)) |> Kanones.formurn
aorindform = generate(compound, aorind, kds)[1]
@test aorindform == knormal("ἐνεκέλευσα")


aorsubj = GMFFiniteVerb(gmpPerson(1), gmpNumber(1), gmpTense("aorist"), gmpMood("subjunctive"), gmpVoice(1)) |> formurn
aorsubj = GMFFiniteVerb(gmpPerson(1), gmpNumber(1), gmpTense("aorist"), gmpMood("subjunctive"), gmpVoice(1)) |> Kanones.formurn
aorsubjform = generate(compound, aorsubj, kds)[1]
@test aorsubjform == knormal("ἐγκελεύσω")


pftact = GMFFiniteVerb(gmpPerson(1), gmpNumber(1), gmpTense("perfect"), gmpMood(1), gmpVoice("active")) |> formurn
pftact = GMFFiniteVerb(gmpPerson(1), gmpNumber(1), gmpTense("perfect"), gmpMood(1), gmpVoice("active")) |> Kanones.formurn
pftactform = generate(compound, pftact, kds)[1]
@test pftactform == knormal("ἐγκεκέλευκα")

plupft = GMFFiniteVerb(gmpPerson(1), gmpNumber(1), gmpTense("pluperfect"), gmpMood(1), gmpVoice(1)) |> formurn
plupft = GMFFiniteVerb(gmpPerson(1), gmpNumber(1), gmpTense("pluperfect"), gmpMood(1), gmpVoice(1)) |> Kanones.formurn
plupftform = generate(compound, plupft, kds)[1]
@test plupftform == knormal("ἐνεκεκελεύκη")


pftmp = GMFFiniteVerb(gmpPerson(1), gmpNumber(1), gmpTense("perfect"), gmpMood(1), gmpVoice("passive")) |> formurn
pftmp = GMFFiniteVerb(gmpPerson(1), gmpNumber(1), gmpTense("perfect"), gmpMood(1), gmpVoice("passive")) |> Kanones.formurn
pftmpform = generate(compound, pftmp, kds)[1]
@test pftmpform == knormal("ἐγκεκέλευμαι")

aorpass = GMFFiniteVerb(gmpPerson(1), gmpNumber(1), gmpTense("aorist"), gmpMood(1), gmpVoice("passive")) |> formurn
aorpass = GMFFiniteVerb(gmpPerson(1), gmpNumber(1), gmpTense("aorist"), gmpMood(1), gmpVoice("passive")) |> Kanones.formurn
aorpassform = generate(compound, aorpass, kds)[1]
@test aorpassform == knormal("ἐνεκελεύθην")


futpass = GMFFiniteVerb(gmpPerson(1), gmpNumber(1), gmpTense("future"), gmpMood(1), gmpVoice("passive")) |> formurn
futpass = GMFFiniteVerb(gmpPerson(1), gmpNumber(1), gmpTense("future"), gmpMood(1), gmpVoice("passive")) |> Kanones.formurn
futpassform = generate(compound, futpass, kds)[1]
@test futpassform == knormal("ἐγκελευθήσομαι")

Expand All @@ -83,47 +83,47 @@ end
kds = joinpath(repo, "datasets", "literarygreek-rules") |> dataset
compound = LexemeUrn("lsj.n30252")

presact = GMFInfinitive(gmpTense(1), gmpVoice(1)) |> formurn
presact = GMFInfinitive(gmpTense(1), gmpVoice(1)) |> Kanones.formurn
presactform = generate(compound, presact, kds)[1]
@test presactform == knormal("ἐγκελεύειν")


futact = GMFInfinitive(gmpTense("future"), gmpVoice(1)) |> formurn
futact = GMFInfinitive(gmpTense("future"), gmpVoice(1)) |> Kanones.formurn
futactform = generate(compound, futact, kds)[1]
@test futactform == knormal("ἐγκελεύσειν")

futmid = GMFInfinitive(gmpTense("future"), gmpVoice("middle")) |> formurn
futmid = GMFInfinitive(gmpTense("future"), gmpVoice("middle")) |> Kanones.formurn
futmidform = generate(compound, futmid, kds)[1]
@test futmidform == knormal("ἐγκελεύσεσθαι")


aoract = GMFInfinitive(gmpTense("aorist"), gmpVoice(1)) |> formurn
aoract = GMFInfinitive(gmpTense("aorist"), gmpVoice(1)) |> Kanones.formurn
aoractform = generate(compound, aoract, kds)[1]
@test aoractform == knormal("ἐγκελεῦσαι")


aormid = GMFInfinitive(gmpTense("aorist"), gmpVoice(2)) |> formurn
aormid = GMFInfinitive(gmpTense("aorist"), gmpVoice(2)) |> Kanones.formurn
aormidform = generate(compound, aormid, kds)[1]
@test aormidform == knormal("ἐγκελεύσασθαι")



pftact = GMFInfinitive(gmpTense("perfect"), gmpVoice(1)) |> formurn
pftact = GMFInfinitive(gmpTense("perfect"), gmpVoice(1)) |> Kanones.formurn
pftactform = generate(compound, pftact, kds)[1]
@test pftactform == knormal("ἐγκεκελευκέναι")


pftmp = GMFInfinitive(gmpTense("perfect"), gmpVoice(2)) |> formurn
pftmp = GMFInfinitive(gmpTense("perfect"), gmpVoice(2)) |> Kanones.formurn
pftmpform = generate(compound, pftmp, kds)[1]
@test pftmpform == knormal("ἐγκεκελεύσθαι")


futpass = GMFInfinitive(gmpTense("future"), gmpVoice("passive")) |> formurn
futpass = GMFInfinitive(gmpTense("future"), gmpVoice("passive")) |> Kanones.formurn
futpassform = generate(compound, futpass, kds)[1]
@test futpassform == knormal("ἐγκελευθήσεσθαι")


aorpass = GMFInfinitive(gmpTense("aorist"), gmpVoice(3)) |> formurn
aorpass = GMFInfinitive(gmpTense("aorist"), gmpVoice(3)) |> Kanones.formurn
aorpassform = generate(compound, aorpass, kds)[1]
@test aorpassform == knormal("ἐγκελευθῆναι")
end
Expand All @@ -133,7 +133,7 @@ end
kds = joinpath(repo, "datasets", "literarygreek-rules") |> dataset
compound = LexemeUrn("lsj.n30252")

vadj = GMFVerbalAdjective(gmpGender("neuter"), gmpCase("accusative"), gmpNumber(1)) |> formurn
vadj = GMFVerbalAdjective(gmpGender("neuter"), gmpCase("accusative"), gmpNumber(1)) |> Kanones.formurn
vadjform = generate(compound, vadj, kds)[1]
@test vadjform == knormal("ἐγκελευτέον")

Expand All @@ -146,40 +146,40 @@ end
compound = LexemeUrn("lsj.n30252")


presact = GMFParticiple(gmpTense(1), gmpVoice(1), gmpGender(1), gmpCase(1), gmpNumber(1)) |> formurn
presact = GMFParticiple(gmpTense(1), gmpVoice(1), gmpGender(1), gmpCase(1), gmpNumber(1)) |> Kanones.formurn
presactform = generate(compound, presact, kds)[1]
@test presactform == knormal("ἐγκελεύων")

presmp = GMFParticiple(gmpTense(1), gmpVoice(2), gmpGender(1), gmpCase(1), gmpNumber(1)) |> formurn
presmp = GMFParticiple(gmpTense(1), gmpVoice(2), gmpGender(1), gmpCase(1), gmpNumber(1)) |> Kanones.formurn
presmpform = generate(compound, presmp, kds)[1]
@test presmpform == knormal("ἐγκελευόμενος")


futact = GMFParticiple(gmpTense("future"), gmpVoice(1), gmpGender(1), gmpCase(1), gmpNumber(1)) |> formurn
futact = GMFParticiple(gmpTense("future"), gmpVoice(1), gmpGender(1), gmpCase(1), gmpNumber(1)) |> Kanones.formurn
futactform = generate(compound, futact, kds)[1]
@test futactform == knormal("ἐγκελεύσων")

aoract = GMFParticiple(gmpTense("aorist"), gmpVoice(1), gmpGender(1), gmpCase(1), gmpNumber(1)) |> formurn
aoract = GMFParticiple(gmpTense("aorist"), gmpVoice(1), gmpGender(1), gmpCase(1), gmpNumber(1)) |> Kanones.formurn
aoractform = generate(compound, aoract, kds)[1]
@test aoractform == knormal("ἐγκέλευσας")


pftact = GMFParticiple(gmpTense("perfect"), gmpVoice(1), gmpGender(1), gmpCase(1), gmpNumber(1)) |> formurn
pftact = GMFParticiple(gmpTense("perfect"), gmpVoice(1), gmpGender(1), gmpCase(1), gmpNumber(1)) |> Kanones.formurn
pftactform = generate(compound, pftact, kds)[1]
@test pftactform == knormal("ἐγκεκελευκώς")

pftmp = GMFParticiple(gmpTense("perfect"), gmpVoice(2), gmpGender(1), gmpCase(1), gmpNumber(1)) |> formurn
pftmp = GMFParticiple(gmpTense("perfect"), gmpVoice(2), gmpGender(1), gmpCase(1), gmpNumber(1)) |> Kanones.formurn
pftmpform = generate(compound, pftmp, kds)[1]
@test pftmpform == knormal("ἐγκεκελευμένος")



aorpass = GMFParticiple(gmpTense("aorist"), gmpVoice("passive"), gmpGender(1), gmpCase(1), gmpNumber(1)) |> formurn
aorpass = GMFParticiple(gmpTense("aorist"), gmpVoice("passive"), gmpGender(1), gmpCase(1), gmpNumber(1)) |> Kanones.formurn
aorpassform = generate(compound, aorpass, kds)[1]
@test aorpassform == knormal("ἐγκελευθεῖς")


futpass = GMFParticiple(gmpTense("future"), gmpVoice("passive"), gmpGender(1), gmpCase(1), gmpNumber(1)) |> formurn
futpass = GMFParticiple(gmpTense("future"), gmpVoice("passive"), gmpGender(1), gmpCase(1), gmpNumber(1)) |> Kanones.formurn
futpassform = generate(compound, futpass, kds)[1]
@test futpassform == knormal("ἐγκελευθησόμενος")
end
2 changes: 1 addition & 1 deletion test/rules/test_finiteverbrules.jl
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ end
@test ending(rule) == "νυσαι"

# morphological data
formabbr = formurn(rule)
formabbr = Kanones.formurn(rule)
expectedabbr = FormUrn("forms.3211120000")
@test formabbr == expectedabbr

Expand Down
2 changes: 1 addition & 1 deletion test/rules/test_infinitiverules.jl
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ end
@test ending(rule) == "ειν"

# morphological data
formabbr = formurn(rule)
formabbr = Kanones.formurn(rule)
expectedabbr = FormUrn("forms.4001010000")
@test formabbr == expectedabbr

Expand Down
2 changes: 1 addition & 1 deletion test/rules/test_nounrules.jl
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ end
@test ending(rule) == "ος"

# morphological data
formabbr = formurn(rule)
formabbr = Kanones.formurn(rule)
expectedabbr = FormUrn("forms.2010001100")
@test formabbr == expectedabbr

Expand Down
2 changes: 1 addition & 1 deletion test/rules/test_ptcplrules.jl
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ end
@test ending(rule) == "όμενος"

# morphological data
formabbr = formurn(rule)
formabbr = Kanones.formurn(rule)
expectedabbr = FormUrn("forms.5011021100")
@test formabbr == expectedabbr

Expand Down
2 changes: 1 addition & 1 deletion test/rules/test_verbaladjrules.jl
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ end
@test ending(rule) == "τέον"

# morphological data
formabbr = formurn(rule)
formabbr = Kanones.formurn(rule)
expectedabbr = FormUrn("forms.6010003100")
@test formabbr == expectedabbr

Expand Down
1 change: 1 addition & 0 deletions test/select_tests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ using CitableObject, CitableParserBuilder
using CitableCorpus, CitableText
using PolytonicGreek, Orthography
using Unicode

using Test
using TestSetExtensions

Expand Down
2 changes: 1 addition & 1 deletion test/stems/test_irregularadjstems.jl
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,6 @@ end
@test lexeme(stem) == LexemeUrn("lsj.n79904")
@test stemstring(stem) == "πᾶς"
@test code(stem) == "7010001110"
@test formurn(stem) == FormUrn("forms.7010001110")
@test Kanones.formurn(stem) == FormUrn("forms.7010001110")

end
2 changes: 1 addition & 1 deletion test/stems/test_irregularfiniteverbstems.jl
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,6 @@ end
@test lexeme(stem) == LexemeUrn("lsj.n31130")
@test Unicode.normalize(stemstring(stem)) == Unicode.normalize("ἐστι")
@test code(stem) == "3311110000"
@test formurn(stem) == FormUrn("forms.3311110000")
@test Kanones.formurn(stem) == FormUrn("forms.3311110000")

end
2 changes: 1 addition & 1 deletion test/stems/test_irregularinfinitivestems.jl
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,6 @@ end
@test lexeme(stem) == LexemeUrn("lsj.n31130")
@test stemstring(stem) == "εἶναι"
@test code(stem) == "4001010000"
@test formurn(stem) == FormUrn("forms.4001010000")
@test Kanones.formurn(stem) == FormUrn("forms.4001010000")

end
2 changes: 1 addition & 1 deletion test/stems/test_irregularnounstems.jl
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,6 @@ end
@test lexeme(stem) == LexemeUrn("lsj.n23069")
@test stemstring(stem) == "γυνή"
@test code(stem) == "2010002100"
@test formurn(stem) == FormUrn("forms.2010002100")
@test Kanones.formurn(stem) == FormUrn("forms.2010002100")

end
2 changes: 1 addition & 1 deletion test/stems/test_pronstems.jl
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,6 @@ end
@test lexeme(stem) == LexemeUrn("lsj.n71882")
@test stemstring(stem) == Unicode.normalize("")
@test code(stem) == "9010001100"
@test formurn(stem) == FormUrn("forms.9010001100")
@test Kanones.formurn(stem) == FormUrn("forms.9010001100")

end
Loading

0 comments on commit 8f30b5b

Please sign in to comment.