Module:Chak-utilities/documentation: Difference between revisions

From The Languages of David J. Peterson
Jump to navigation Jump to search
No edit summary
No edit summary
Line 1: Line 1:
Utilities for [[Chakobsa]] scripts. Implements {{temp|chak-from-root}}.
Utilities for [[Chakobsa]] scripts. Implements {{temp|chak-from-root}}.


Exposed functions:
====Exposed functions====
<pre>
is_geminate(input)


extract_root(input)
:{{code|lua|l(term, face, alt)}}
;Creates a link to a Chakobsa lexeme - similar to {{temp|l|chak|term}}


geminate_char(input)
:{{code|lua|is_geminate(char)}}
; returns true if the supplied 'character' is geminate


degeminate_char(input)
:{{code|lua|compress_consonants(str)}}
;Returns a 'compressed' version of the string where consonant digraphs are reduced to a single character and trigraph geminates are reduced to a geminate of a single character. Mostly for use with other functions for parsing.


assimilate(input)</pre>
:{{code|lua|expand_consonants(str)}}
;Returns an 'expanded' version of the string where reductions from <code>compress_consonants</code> are replaced with the original romanizations.
 
:{{code|lua|parse_consonants(str)}}
; Returns a string where the consonants have been split out, delimited by hyphens. Understands geminate consonants and considers them a 'single' consonant.
 
:{{code|lua|parse_root(root_str,expandFinal)}}
; Returns a table of parts of the root string is grouped by consonant and vowels. Example: "kkaalatg" > {{"kk","aa","l","a","tg"}}. If expandFinal is true, returns the final part parsed out through <code>parse_consonants</code> The above example would be "kkaalatg" > {{"kk","aa","l","a","t-g"}}. Used for inflection functions.

Revision as of 16:03, 24 October 2023

Utilities for Chakobsa scripts. Implements {{chak-from-root}}.

Exposed functions

l(term, face, alt)
Creates a link to a Chakobsa lexeme - similar to {{l|chak|term}}
is_geminate(char)
returns true if the supplied 'character' is geminate
compress_consonants(str)
Returns a 'compressed' version of the string where consonant digraphs are reduced to a single character and trigraph geminates are reduced to a geminate of a single character. Mostly for use with other functions for parsing.
expand_consonants(str)
Returns an 'expanded' version of the string where reductions from compress_consonants are replaced with the original romanizations.
parse_consonants(str)
Returns a string where the consonants have been split out, delimited by hyphens. Understands geminate consonants and considers them a 'single' consonant.
parse_root(root_str,expandFinal)
Returns a table of parts of the root string is grouped by consonant and vowels. Example
"kkaalatg" > Template:"kk","aa","l","a","tg". If expandFinal is true, returns the final part parsed out through parse_consonants The above example would be "kkaalatg" > Template:"kk","aa","l","a","t-g". Used for inflection functions.