API documentation

Published

June 4, 2024

String composition

strcat

Concatenate 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)

sortWords

Alphabetically sort a list of words in Unicode Greek.

sortWords(words, ortho)

Phonology

vocalic

True if s is a vowel or diphthong.

vocalic(s)

True if c is a vowel or diphthong.

vocalic(c)

consonantal

True if s is a consonant.

consonantal(s)

liquids

Identify code points representing liquid consonants.

liquids(ortho)

List code points for liquid consonants in literary Greek.

liquids(ortho)

labials

Identify code points representing liquid consonants.

liquids(ortho)

List code points for liquid consonants in literary Greek.

liquids(ortho)

dentals

Identify code points representing dental consonants.

dentals(ortho)

List code points for dental consonants in literary Greek.

dentals(ortho)

palatals

Identify code points representing palatal consonants.

palatals(ortho)

List code points for palatal consonants in literary Greek.

palatals(ortho)

stops

Identify code points representing stops.

stops(ortho)

Reduplication and augment

augment

Generic method of function to augment a string.

augment(s, ortho)

Parameters

  • ortho An instance of a GreekOrthography

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 a LiteraryGreekOrthography
  • 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).

augment_initial

Generic method of function to identify string for syllabic augment in initial position.

augment_initial(ortho)

Parameters

  • ortho An instance of a GreekOrthography

Identify string to use for syllabic augment in word-initial position.

augment_initial(ortho)

augment_medial

Generic method of function to identify string for syllabic augment when preceded by a prefix.

augment_medial(ortho)

Parameters

  • ortho An instance of a GreekOrthography

Identify string to use for syllabic augment in compound verb.

augment_medial(ortho)

reduplicate

Add 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

rmaccents

Remove all accent characters from s.

rmaccents(s, ortho)

Parameters

  • s is a Greek string
  • ortho is an implementation of GreekOrthography

Default to using literary Greek orthography for rmaccents.

rmaccents(s)

Implement GreekOrthography’s rmaccents function for LiteraryGreekOrthography.

rmaccents(s, ortho)

accentword

Accent word s.

accentword(s, placement, ortho)

Parameters

  • s is a Greek string
  • placement is :RECESSIVE, or :PENULT
  • ortho is an implementation of GreekOrthography

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.

accented

True if s has at least one accent.

accented(s)

proclitics

List proclitics in this orthography.

proclitics(ortho)

List proclitics in LiteraryGreekOrthography.

proclitics(ortho)

Based on Smyth ¶ 179.

enclitics

List enclitics in this orthography.

enclitics(ortho)

List enclitics in LiteraryGreekOrthography.

enclitics(ortho)

Based on Smyth ¶ 181.

rmbreathing

Remove any breathing from s.

rmbreathing(s, ortho)

addbreathing

Add the specified breathing to s.

addbreathing(s, breath, ortho)

breath should be one of :SMOOTH or :ROUGH.

countaccents

Count accents in s.

countaccents(s, ortho)

Parameters

  • s is a Greek string
  • ortho is an implementation of GreekOrthography

Default to using literary Greek orthography for countaccents.

countaccents(s)

Counts number of accents in s.

countaccents(s, ortho)

accentpenult

Accent penultimate syllable of wrd.

accentpenult(wrd, accent, ortho)

Parameters

  • s is a Greek string
  • accent is :ACUTE, or :CIRCUMFLEX
  • ortho is an implementation of GreekOrthography

Place accent on penult.

accentpenult(wrd, accent)
accentpenult(wrd, accent, ortho)

accentultima

Accent final syllable of wrd.

accentultima(wrd, accent, ortho)

Parameters

  • s is a Greek string
  • accent is :ACUTE, or :CIRCUMFLEX
  • ortho is an implementation of GreekOrthography

Place accent on ultima.

accentultima(wrd, accent)
accentultima(wrd, accent, ortho)

Syllabification

syllabify

Generic 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

LiteraryGreekOrthography

An orthographic system for standard orthography of printed literary Greek.

literaryGreek

Instantiate 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
PolytonicGreek.splitmunu
PolytonicGreek.splitliqcons
PolytonicGreek.splitdiphthongvowel
PolytonicGreek.splitvoweldiphthong

Internals

PolytonicGreek.alphabetic
PolytonicGreek.punctuation
PolytonicGreek.isAlphabetic
PolytonicGreek.isPunctuation
PolytonicGreek.tokenforstring
PolytonicGreek.splitPunctuation

Internals

PolytonicGreek.allaccents
PolytonicGreek.accentstripdict
PolytonicGreek.flipdict
PolytonicGreek.acutedict
PolytonicGreek.circumflexdict
PolytonicGreek.addacute
PolytonicGreek.addcircumflex
PolytonicGreek.accentsyllable
PolytonicGreek.accentantepenult
PolytonicGreek.ultima
PolytonicGreek.penult
PolytonicGreek.longsyllable
PolytonicGreek.shortsyllable
PolytonicGreek.includesdiphthong
PolytonicGreek.flipaccent
PolytonicGreek.vowelsonly
PolytonicGreek.tokenform
PolytonicGreek.stripenclitic
PolytonicGreek.normalizediaresis
PolytonicGreek.normalizeaccentcombos