From 9619b4a07ce3b8c1a4303fc6702976ab9ae5f190 Mon Sep 17 00:00:00 2001 From: Sorrel Bri Date: Sat, 9 May 2020 16:24:00 -0700 Subject: [PATCH] update latl README with set definition --- README.md | 6 ++++++ public/latl/waffle.latl | 10 ++++++++-- src/utils/grammar.js | 0 src/utils/latl/README.md | 10 ++++++++++ 4 files changed, 24 insertions(+), 2 deletions(-) delete mode 100644 src/utils/grammar.js diff --git a/README.md b/README.md index 69b534c..22a7d47 100644 --- a/README.md +++ b/README.md @@ -14,6 +14,12 @@ Features: - multi-character phone support - comparative runs for multiple rule sets +## What is LATL? + +[Read the specification](/src/utils/latl/README.md) + +LATL is a JavaScript targeting compiled language for doing linguistic analysis and transformations. + ## How do I use FCA? An FCA run requires the user to define three parameters: diff --git a/public/latl/waffle.latl b/public/latl/waffle.latl index 281ad3e..6222e17 100644 --- a/public/latl/waffle.latl +++ b/public/latl/waffle.latl @@ -62,11 +62,17 @@ set PLOSIVES [ p, pʰ, t, tʼ, tʰ, ɾ, kʼ, k, kʰ ] ; ---- TENTATIVE! ; ---- set feature operations - non-mutable! -; { [ X + feature1 - feature2 ] in SET_A } FILTER: where X is any character and feature1 and feature2 are filtering features +; { [ + feature1 - feature2 ] in SET_A } FILTER: where feature1 and feature2 are filtering features ; { SET_A yield [ X + feature1 ] } TRANSFORMATION: performs transformation with (prepended or) appended character ; { SET_A yield [ X - feature1 ] } ; { SET_A yield [ X - feature1 + feature2 ] } -; { [ X + feature1 - feature2 ] in SET_A yield [ - feature1 + feature2 ] } combined FILTER and TRANSFROMATION +; { [ X + feature1 - feature2 ] in SET_A yield [ - feature1 + feature2 ] } combined FILTER and TRANSFORMATION + +; ---- MAPPING +set PLOSIVES = [ p, t, k ], + FRICATIVES = [ f, s, x ], + ; pairs PLOSIVES with FRICATIVES that have matching features = [ pf, ts, kx ] + AFFRICATES = { PLOSIVES yield [ X concat { [ [ X ] - fricative ] in FRICATIVES } ] } ; ---- example with join, character, and feature operations ; set SET_C = { [ PHONE +feature1 ] in { SET_A or SET_B } yield [ PHONE concat y ] } diff --git a/src/utils/grammar.js b/src/utils/grammar.js deleted file mode 100644 index e69de29..0000000 diff --git a/src/utils/latl/README.md b/src/utils/latl/README.md index 865a1bf..2beb442 100644 --- a/src/utils/latl/README.md +++ b/src/utils/latl/README.md @@ -34,6 +34,16 @@ Sets are collections of pointers to phones. The GLOBAL set contains all phones, #### Global Set [ GLOBAL ] is a shorthand for [ GLOBAL.SETS ] #### Set Definition +Sets are defined with the set keyword followed by an equal sign and a set expression: +``` +set SHORT_VOWELS = [ a, i, u ] +``` +Lists of sets can be defined using a comma followed by whitespace syntax +``` +set PLOSIVES = [ p, t, k ], + FRICATIVES = [ f, s, x ], + LABIALIZED_PLOSIVES = { PLOSIVES yield [ X concat ʷ ] } +``` #### Set Usage #### Set Operations ##### 'and' Operation