Skip to content

Commit

Permalink
Merge pull request #198 from neelsmith/dev
Browse files Browse the repository at this point in the history
Catch an edge case in phonological interaction of palatals
  • Loading branch information
neelsmith authored Aug 23, 2023
2 parents 5563638 + 5273b1a commit aaeb64d
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "PolytonicGreek"
uuid = "72b824a7-2b4a-40fa-944c-ac4f345dc63a"
authors = ["Neel Smith <dnsmith.neel@gmail.com>"]
version = "0.21.7"
version = "0.21.8"

[deps]
Compat = "34da2185-b29b-5c13-b0c7-acf172513d20"
Expand Down
9 changes: 6 additions & 3 deletions src/litgreek/lgstrcat.jl
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ $(SIGNATURES)
"""
function strcat(ortho::LiteraryGreekOrthography, s1::AbstractString,s2::AbstractString; elision = false)

@debug("Strcatting $(s1) and $(s2)")
@info("Strcatting $(s1) and $(s2)")
part2 = rmbreathing(s2, ortho)
s1 = elision ? elide(s1, part2, ortho) : s1
@debug("strcat: After elision, s1 is ", s1)
Expand Down Expand Up @@ -83,6 +83,7 @@ end
$(SIGNATURES)
"""
function lg_appendtopalatal(s1::AbstractString, s2::AbstractString)
@info("Appending str to palatal")
# Aspirate s1 if s2 starts with rough breathing:
if lginitialrough(s2)
indices = collect(eachindex(s1))
Expand Down Expand Up @@ -134,9 +135,11 @@ function lg_appendtopalatal(s1::AbstractString, s2::AbstractString)
quit = indices[end - 1]
string(s1[1:quit],"χ", s2)

elseif endswith(s1, "χ") && occursin(r"^[κγχ]", s2)
elseif occursin(r"[χκ]$", s1) && occursin(r"^[κγχ]", s2)
if length(s2) == 1
s1
indices = collect(eachindex(s1))
quit = indices[end - 1]
string(s1[1:quit],"χ")
else
indices = collect(eachindex(s2))
quit = indices[2:end]
Expand Down
2 changes: 2 additions & 0 deletions test/test_strcat.jl
Original file line number Diff line number Diff line change
Expand Up @@ -103,5 +103,7 @@ end
@test strcat(ortho,"ἐβη", "") == "ἐβη"

@test strcat(ortho,"ἀρχ", "κ") == "ἀρχ"
@test strcat(ortho,"δεικ", "κ") == "δειχ"
@test strcat(ortho,"ἐγ", "κ") == "ἐγκ"

end

0 comments on commit aaeb64d

Please sign in to comment.