diff --git a/Project.toml b/Project.toml index 475ee25..923a730 100644 --- a/Project.toml +++ b/Project.toml @@ -1,7 +1,7 @@ name = "PolytonicGreek" uuid = "72b824a7-2b4a-40fa-944c-ac4f345dc63a" authors = ["Neel Smith "] -version = "0.21.3" +version = "0.21.4" [deps] Compat = "34da2185-b29b-5c13-b0c7-acf172513d20" diff --git a/src/litgreek/lgaccentuate.jl b/src/litgreek/lgaccentuate.jl index d0ee186..9c4dd69 100644 --- a/src/litgreek/lgaccentuate.jl +++ b/src/litgreek/lgaccentuate.jl @@ -174,13 +174,13 @@ $(SIGNATURES) """ function accentpenult(wrd::AbstractString, accent::Symbol, ortho::LiteraryGreekOrthography = literaryGreek()) sylls = syllabify(wrd, ortho) - @debug("Accenting penult, sylls $(syll)") + @info("Accenting penult, sylls $(sylls)") if length(sylls) < 2 @warn("accentpenult: can't accent word with fewer than two syllables $wrd") nothing else pen = penult(wrd,ortho) - @debug("Get the penult: $(pen)") + @info("Get the penult: $(pen)") sylls[end - 1] = accentsyllable(penult(wrd, ortho), accent) strcat(ortho, sylls...) @@ -223,7 +223,7 @@ additional morphological information beyond the string value of the token. """ function accentword(wrd::AbstractString, placement::Symbol, ortho::LiteraryGreekOrthography = literaryGreek()) sylls = syllabify(wrd, ortho) - @debug("Acccent syllabified $(wrd) to $(sylls)") + @info("Acccent syllabified $(wrd) to $(sylls)") ult = ultima(wrd, ortho) if placement == :PENULT if length(sylls) < 2 @@ -247,6 +247,7 @@ function accentword(wrd::AbstractString, placement::Symbol, ortho::LiteraryGreek nothing else if length(sylls) == 2 + @info("2 sylls, so again invoke accentword but now with syll specified as penult") accentword(wrd, :PENULT) elseif finallong(ult, ortho) diff --git a/src/litgreek/lgstrcat.jl b/src/litgreek/lgstrcat.jl index df271b0..0c8eaca 100644 --- a/src/litgreek/lgstrcat.jl +++ b/src/litgreek/lgstrcat.jl @@ -7,7 +7,7 @@ function strcat(ortho::LiteraryGreekOrthography, s1::AbstractString,s2::Abstract @debug("Strcatting $(s1) and $(s2)") part2 = rmbreathing(s2, ortho) s1 = elision ? elide(s1, part2, ortho) : s1 - @debug("strcat: After elision, s1 is ", s1) + @info("strcat: After elision, s1 is ", s1) if isempty(s1) s2 @@ -23,6 +23,7 @@ function strcat(ortho::LiteraryGreekOrthography, s1::AbstractString,s2::Abstract lg_appendtolabial(s1,part2) |> nfkc elseif occursin(r"[τδθ]$", s1) + @info("Cat") lg_appendtodental(s1,part2) |> nfkc elseif occursin(r"[κγχ]$", s1) @@ -139,12 +140,17 @@ end $(SIGNATURES) """ function lg_appendtodental(s1::AbstractString, s2::AbstractString) + @info("Appending dental $(s1) and $(s2)") + + # Aspirate dental if next syllable starts with rough breathing: if lginitialrough(s2) indices = collect(eachindex(s1)) quit = indices[end - 1] @debug("Reducing s1 to ",string(s1[1:quit],"θ")) string(s1[1:quit],"θ", rmbreathing(s2,literaryGreek())) + # if next syllable starts with σθ, drop σ + # and aspirate dental elseif startswith(s2, "σθ") indices1 = collect(eachindex(s1)) quit1 = indices1[end - 1] @@ -154,12 +160,16 @@ function lg_appendtodental(s1::AbstractString, s2::AbstractString) string(s1[1:quit1], aspirate(s1[indices1[end]]), s2[start2:end] ) - elseif ! occursin(r"^[τδθ]", s2) - s1 * s2 - else + # when an aspirated dental is followed by another dental, + # replace it with ς + elseif endswith(s1, "θ") && occursin(r"^[τδθ]", s2) indices = collect(eachindex(s1)) quit = indices[end - 1] string(s1[1:quit],"σ", s2) + + # Just cat the two together: + else + s1 * s2 end end diff --git a/test/test_accentuation.jl b/test/test_accentuation.jl index 7f8c79c..d309637 100644 --- a/test/test_accentuation.jl +++ b/test/test_accentuation.jl @@ -106,4 +106,5 @@ end lg = literaryGreek() @test accentword("ἐν#κελευω", :RECESSIVE, lg) == nfkc("ἐγκελεύω") @test accentword("νοηματος", :RECESSIVE, lg) == nfkc("νοήματος") + @test accentword("πραττω", :RECESSIVE, lg) == nfkc("πράττω") end \ No newline at end of file