API documentation
String composition
PolytonicGreek.strcat
— FunctionConcatenate s1
and a list of strings slist
, taking account of any phonological modifications required by orthography ortho
.
strcat(ortho, s1, slist; elision)
Concatenate the pair of strings s1
and s2
, taking account of any phonological modifications required by orthography ortho
.
strcat(ortho, s1, s2)
Concatenate s1
and s2
d, taking account of necessary phonological modifications.
strcat(ortho, s1, s2; elision)
PolytonicGreek.sortWords
— FunctionAlphabetically sort a list of words in Unicode Greek.
sortWords(words, ortho)
Phonology
PolytonicGreek.vocalic
— FunctionTrue if s
is a vowel or diphthong.
vocalic(s)
True if c
is a vowel or diphthong.
vocalic(c)
PolytonicGreek.consonantal
— FunctionTrue if s
is a consonant.
consonantal(s)
PolytonicGreek.liquids
— FunctionIdentify code points representing liquid consonants.
liquids(ortho)
List code points for liquid consonants in literary Greek.
liquids(ortho)
PolytonicGreek.labials
— FunctionIdentify code points representing labial consonants.
labials(ortho)
List code points for labial consonants in literary Greek.
labials(ortho)
PolytonicGreek.dentals
— FunctionIdentify code points representing dental consonants.
dentals(ortho)
List code points for dental consonants in literary Greek.
dentals(ortho)
PolytonicGreek.palatals
— FunctionIdentify code points representing palatal consonants.
palatals(ortho)
List code points for palatal consonants in literary Greek.
palatals(ortho)
PolytonicGreek.stops
— FunctionIdentify code points representing stops.
stops(ortho)
Reduplication and augment
PolytonicGreek.augment
— FunctionGeneric method of function to augment a string.
augment(s, ortho)
Parameters
ortho
An instance of aGreekOrthography
Implementatiοn of GreekOrthography's augment function for literary Greek.
augment(s, ortho)
NB: augment
removes all accents from the resulting string.
Parameters
ortho
An instance of aLiteraryGreekOrthography
s
An optional string to augment. If is not included, the function returns
a default augment string that can be applied to verb forms starting with a consonant (except note that ρ doubles after augment in standard literary Greek orthography).
PolytonicGreek.augment_initial
— FunctionGeneric method of function to identify string for syllabic augment in initial position.
augment_initial(ortho)
Parameters
ortho
An instance of aGreekOrthography
Identify string to use for syllabic augment in word-initial position.
augment_initial(ortho)
PolytonicGreek.augment_medial
— FunctionGeneric method of function to identify string for syllabic augment when preceded by a prefix.
augment_medial(ortho)
Parameters
ortho
An instance of aGreekOrthography
Identify string to use for syllabic augment in compound verb.
augment_medial(ortho)
PolytonicGreek.reduplicate
— FunctionAdd reduplications to s
, taking account of any phonological modifications required by orthography ortho
.
reduplicate(s, ortho)
Reduplicate s
, taking account of any necessary phonological modifications.
reduplicate(s, ortho)
Accentuation
PolytonicGreek.rmaccents
— FunctionRemove all accent characters from s
.
rmaccents(s, ortho)
Parameters
s
is a Greek stringortho
is an implementation ofGreekOrthography
Default to using literary Greek orthography for rmaccents.
rmaccents(s)
Implement GreekOrthography's rmaccents function for LiteraryGreekOrthography.
rmaccents(s, ortho)
PolytonicGreek.accentword
— FunctionAccent word s
.
accentword(s, placement, ortho)
Parameters
s
is a Greek stringplacement
is:RECESSIVE
, or:PENULT
ortho
is an implementation ofGreekOrthography
Accent word according to specified system of accent placement.
accentword(wrd, placement)
accentword(wrd, placement, ortho)
Parameters
wrd
is a string value representing a single lexical token.placement
is one of:RECESSIVE
for recessive accent
or :PENULT
for persistent accent on the penultimate syllable.
Note that it is not possible to accent the ultima correctly without additional morphological information beyond the string value of the token.
PolytonicGreek.accented
— FunctionTrue if s
has at least one accent.
accented(s)
PolytonicGreek.proclitics
— FunctionList proclitics in this orthography.
proclitics(ortho)
List proclitics in LiteraryGreekOrthography.
proclitics(ortho)
Based on Smyth ¶ 179.
PolytonicGreek.enclitics
— FunctionList enclitics in this orthography.
enclitics(ortho)
List enclitics in LiteraryGreekOrthography.
enclitics(ortho)
Based on Smyth ¶ 181.
PolytonicGreek.rmbreathing
— FunctionRemove any breathing from s
.
rmbreathing(s, ortho)
PolytonicGreek.addbreathing
— FunctionAdd the specified breathing to s
.
addbreathing(s, breath, ortho)
breath
should be one of :SMOOTH
or :ROUGH
.
PolytonicGreek.countaccents
— FunctionCount accents in s
.
countaccents(s, ortho)
Parameters
s
is a Greek stringortho
is an implementation ofGreekOrthography
Default to using literary Greek orthography for countaccents.
countaccents(s)
Counts number of accents in s
.
countaccents(s, ortho)
PolytonicGreek.accentpenult
— FunctionAccent penultimate syllable of wrd
.
accentpenult(wrd, accent, ortho)
Parameters
s
is a Greek stringaccent
is:ACUTE
, or:CIRCUMFLEX
ortho
is an implementation ofGreekOrthography
Place accent on penult.
accentpenult(wrd, accent)
accentpenult(wrd, accent, ortho)
PolytonicGreek.accentultima
— FunctionAccent final syllable of wrd
.
accentultima(wrd, accent, ortho)
Parameters
s
is a Greek stringaccent
is:ACUTE
, or:CIRCUMFLEX
ortho
is an implementation ofGreekOrthography
Place accent on ultima.
accentultima(wrd, accent)
accentultima(wrd, accent, ortho)
Syllabification
PolytonicGreek.syllabify
— FunctionGeneric method of GreekOrthography's syllabify function.
syllabify(s, ortho)
Allow syllabification defaulting to LiteraryGreekOrthography.
syllabify(s)
Split string s
into an Array of strings representing syllables.
syllabify(s, ortho)
Example
syllables = PolytonicGreek.syllabify("κελεύει")
join(syllables, "-")
"κε-λευ-ει"
Orthographic system
PolytonicGreek.LiteraryGreekOrthography
— TypeAn orthographic system for standard orthography of printed literary Greek.
PolytonicGreek.literaryGreek
— FunctionInstantiate a LiteraryGreekOrthography with correct code points and token types.
literaryGreek()
Internals
Syllabification is implemented with a chain of functions applying regular expressions to an input string. These internal functions would not normally be of any use or interest to anyone who simply wants to break a string in polytonic Greek into syllables.
PolytonicGreek.splitmorphemes
— FunctionRespect explicitly indicated morpheme boundaries.
splitmorphemes(s)
Example
PolytonicGreek.splitmorphemes("εἰσ#ῄα")
"εἰσ ῄα"
PolytonicGreek.splitmunu
— FunctionMu+nu stay together.
splitmunu(s)
ἀναμιμνησκόμενος breaks as "ἀναμι μνησκομενος"
PolytonicGreek.splitliqcons
— FunctionSplit between a liquid and non-liquid consonant.
PolytonicGreek.splitdiphthongvowel
— Functionsplitdiphthongvowel(s)
Split between a diphthong and following vowel.
Example
PolytonicGreek.splitdiphthongvowel("κελεύει")
"κελευ ει"
PolytonicGreek.splitvoweldiphthong
— FunctionSplit between a vowel and a following diphthong.
"οἰκι αις"
Internals
PolytonicGreek.alphabetic
— FunctionCompose a string with all alphabetic characters.
alphabetic()
PolytonicGreek.punctuation
— FunctionCompose a string with all punctuation characters.
punctuation()
PolytonicGreek.isAlphabetic
— FunctionTrue if all characters in s are alphabetic.
isAlphabetic(s)
PolytonicGreek.isPunctuation
— FunctionTrue if all characters in s are puncutation.
isPunctuation(s)
PolytonicGreek.tokenforstring
— FunctionCreate correct OrthographicToken for a given string.
tokenforstring(s)
PolytonicGreek.splitPunctuation
— FunctionSplit off any trailing punctuation and return an Array of leading string + trailing punctuation.
splitPunctuation(s)
Internals
PolytonicGreek.allaccents
— FunctionList all code points including an accent.
allaccents()
Default to using LiteraryGreekOrthography
.
List all code points including an accent in LiteraryGreekOrthography
.
allaccents(ortho)
PolytonicGreek.accentstripdict
— FunctionDictionary mapping Unicode codepoints with accents to codepoint with accent stripped.
accentstripdict()
Default to using LiteraryGreekOrthography
.
Dictionary mapping Unicode codepoints with accents to codepoint with accent stripped for LiteraryGreekOrthography
.
accentstripdict(ortho)
We can't just use Unicode.normalize with stripmark flag because that strips breathings, iota subscripts, and diaereses as well.
PolytonicGreek.flipdict
— FunctionDictionary of barytone to oxytone conversions.
flipdict()
Default to using LiteraryGreekOrthography
.
Dictionary of barytone to oxytone conversions for LiteraryGreekOrthography
.
flipdict(ortho)
PolytonicGreek.acutedict
— FunctionDictionary of acutes.
acutedict()
Default to using LiteraryGreekOrthography
.
Dictionary of acutes for LiteraryGreekOrthography
.
acutedict(ortho)
PolytonicGreek.circumflexdict
— FunctionDictionary of circumflexes.
circumflexdict()
Default to using LiteraryGreekOrthography
.
Dictionary of circumflexes for LiteraryGreekOrthography
.
circumflexdict(ortho)
PolytonicGreek.addacute
— FunctionAdd an acute accent to a single vowel or diphthong.
addacute(vowel)
addacute(vowel, ortho)
Examples
julia> PolytonicGreek.addacute("ᾀ")
"ᾄ"
julia> PolytonicGreek.addacute("τα")
┌ Warning: addacute: can't add acute accent to vowel τα
PolytonicGreek.addcircumflex
— FunctionAdd a circumflex accent to a single vowel or diphthong
addcircumflex(vowel)
addcircumflex(vowel, ortho)
Examples
julia> PolytonicGreek.addcircumflex("ᾀ")
"ᾆ"
julia> PolytonicGreek.addcircumflex("τα")
┌ Warning: addcircumflex: can't add circumflex accent to vowel τα
PolytonicGreek.accentsyllable
— FunctionAdd specified accent to a single syllable.
accentsyllable(syll, accent)
accentsyllable(syll, accent, ortho)
Parameters
syll
is a string value for a single syllable. accent
is either :ACUTE
or :CIRCUMFLEX
. The function returns nothing
for any other symble for accent.
Examples
julia> PolytonicGreek.accentsyllable("των", :CIRCUMFLEX)
"τῶν"
julia> PolytonicGreek.accentsyllable("τα", :ACUTE)
"τά"
julia> PolytonicGreek.accentsyllable("ᾀ", :ACUTE)
"ᾄ"
PolytonicGreek.accentantepenult
— FunctionPlace default accent(:ACUTE) on antepenult.
accentantepenult(wrd, ortho)
PolytonicGreek.ultima
— FunctionReturn ultima.
ultima(s, ortho)
PolytonicGreek.penult
— FunctionReturn penult.
penult(s, ortho)
PolytonicGreek.longsyllable
— FunctionTrue if syll
is metrically long by nature.
longsyllable(syll, ortho)
Arguments
syll
is text for a single syllableortho
is aGreekOrthography
Examples
julia> PolytonicGreek.longsyllable("τει")
true
julia> PolytonicGreek.longsyllable("τε")
false
PolytonicGreek.shortsyllable
— FunctionTrue if syll
is not long by nature.
shortsyllable(syll, ortho)
Examples
julia> PolytonicGreek.shortsyllable("ε")
true
julia> PolytonicGreek.shortsyllable("ει")
false
PolytonicGreek.includesdiphthong
— FunctionTrue if s
contains a diphthong.
includesdiphthong(s)
Examples
julia> PolytonicGreek.includesdiphthong("εὐθύς")
true
julia> PolytonicGreek.includesdiphthong("ᾔα")
false
PolytonicGreek.flipaccent
— FunctionConvert grave accent to acute.
flipaccent(s, ortho)
PolytonicGreek.vowelsonly
— FunctionRemove all consonants from s
.
vowelsonly(s, ortho)
Example
julia> PolytonicGreek.vowelsonly("τῶν")
"ῶ"
PolytonicGreek.tokenform
— FunctionPolytonicGreek.stripenclitic
— FunctionRemove any second enclitic accent from s
.
PolytonicGreek.normalizediaresis
— FunctionCreate NFKC forms of code points with diaeresis.
normalizediaresis()
PolytonicGreek.normalizeaccentcombos
— FunctionCollect a normalized set of all codepoints with accent.
normalizeaccentcombos()