API documentation

Published

June 5, 2024

Public API for MID Orthography model

AtticOrthography

An orthographic system for texts in the pre-Euclidean Attic alphabet.

atticGreek

Instantiate an AtticOrthography with correct code points and token types.

atticGreek()

sortWords

:::{.callout-note appearance=“minimal”}

Alphabetically sort a list of words in Unicode Greek.

sortWords(words, ortho)

Alphabetically sort a list of words in Unicode Greek.

sortWords(words, ortho)

Phonology and syllabification

Exported:

consonants

Identify code points representing consonants.

consonants(ortho)

Implement consonants function of GreekOrthography interface.

consonants(ortho)

Implement GreekOrthography’s consonants function for AtticOrthography.

consonants(attic)

vowels

Identify code points representing simple vowels.

vowels(ortho)

This does not include code points representing vowels combined with accents. It does include any code points representing vowels plus breathing or vowels with subscript.

Implement vowels function of GreekOrthography interface.

vowels(ortho)

Implement GreekOrthography’s vowels function for AtticOrthography.

vowels(attic)

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, "-")
"κε-λευ-ει"

Internal:

AtticGreek.alphabetic

Compose a string with all alphabetic characters.

alphabetic()

AtticGreek.punctuation

Compose a string with all punctuation characters.

AtticGreek.isAlphabetic

True if all characters in s are alphabetic.

isAlphabetic(s)

AtticGreek.isPunctuation

True if all characters in s are puncutation.

isPunctuation(s)

AtticGreek.tokenforstring

Create correct OrthographicToken for a given string.

tokenforstring(s)

AtticGreek.splitPunctuation

Split off any trailing punctuation and return an Array of leading string + trailing punctuation.

splitPunctuation(s)

AtticGreek.ultima

Return ultima.

ultima(s, ag)

AtticGreek.penult

Return penult.

penult(s, ag)

AtticGreek.antepenult

Return antepenult.

antepenult(s, ag)

NB: Rms accent since they’re not relevant to syllables.

AtticGreek.vowelsonly

Remove all consonants from s.

vowelsonly(s, ag)

:::
:::


:::

`AtticGreek.longsyllable`


:::{.callout-note appearance="minimal"}

::: {#620a6f25 .cell execution_count=17}

::: {.cell-output .cell-output-display .cell-output-markdown execution_count=18}
True if `syll` is a long syllable in Attic Greek orthography.

```julia
longsyllable(syll, ortho)

Arguments

  • syll is a single syllable
  • ortho an instance of AtticOrthography

AtticGreek.finallong

True if syll counts as long for accent in ultima.

finallong(syll, ortho)

AtticGreek.finalshort

True if syll counts as short for accent in ultima.

finalshort(syll, ortho)

Accentuation

Exported:

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)

Implement GreekOrthography’s rmaccents function for LiteraryGreekOrthography.

rmaccents(s, ortho)

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)

Counts number of accents in s.

countaccents(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.

Accent word according to specified system of accent 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.

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)

Place specified accent on final syllable of wrd.

accentultima(wrd, accent, ortho)

accent is one of either :ACUTE or :CIRCUMFLEX. The function returns nothing for any other symbol for accent.

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)

Place specified accent on penult of wrd.

accentpenult(wrd, accent, ortho)

accent is one of either :ACUTE or :CIRCUMFLEX. The function returns nothing for any other symbol for accent.

accentantepenult

Place default accent(:ACUTE) on antepenult.

accentantepenult(wrd, ortho)

Accent wrd proparoxytone.

accentantepenult(wrd, ortho)

Internal:

AtticGreek.stripenclitic

Remove any second accent due to enclisis from s.

stripenclitic(s, ortho)

AtticGreek.addacute

Add an acute accent to a single vowel or diphthong.

addacute(vowel, ortho)

AtticGreek.addcircumflex

Add a circumflex accent to a single vowel or diphthong

addcircumflex(vowel, ortho)

AtticGreek.accentstripdict

Map accented vowels to unaccented forms, but keep smooth breathing

accentstripdict(ortho)

AtticGreek.flipaccent

Convert grave accent to acute.

flipaccent(s, ag)

AtticGreek.tokenform

Normalize s to a standard form with no enclitics, and all barytone accent converted to oxytone.

tokenform(s, ortho)

AtticGreek.accentsyllable

Add specified accent to a single syllable.

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 symbol for accent.