From cfab840bb05e2e0cf8ccf63d5b0fe57c19652cb1 Mon Sep 17 00:00:00 2001 From: Lucien Cartier-Tilet Date: Sat, 4 Apr 2020 18:11:26 +0200 Subject: [PATCH] Updated README --- README.org | 158 ++++++++++++++++++++++++++++++++++++++--------------- 1 file changed, 113 insertions(+), 45 deletions(-) diff --git a/README.org b/README.org index e1c69e0..79a0a96 100644 --- a/README.org +++ b/README.org @@ -48,38 +48,42 @@ } #+END_SRC + As you can see, backreferences have their syntax modified from ~\1~ to ~$1~ + for instance, and look-ahead and look-behind expressions must be incorporated + into the expression. + And here is the JSON generated by this project (beautified, the original is on one line only without unnecessary whitespace): #+BEGIN_SRC json { "version": "1", "categories": { - "B": "ou", - "C": "ptcqbdgmnlrhs", - "F": "ie", - "Z": "bgd", - "L": "āēīōū", "S": "ptc", - "V": "aeiou" + "L": "āēīōū", + "V": "aeiou", + "Z": "bgd", + "F": "ie", + "C": "ptcqbdgmnlrhs", + "B": "ou" }, - "rules": { - "(?P%B)ct": "$but", - "(?P%V)t(?P%V)": "$bd$a", - "u$": "o", - "(?P%V)c(?P%V)": "$bg$a", - "(?P%V)v(?P%V)": "$b$a", - "gn": "nh", - "ii": "i", - "(?P%F)ct": "$fit", - "i(?P%V)": "j$v", - "(?P%V)p(?P%V)": "$vb$a", - "(?P%Vr)e$": "$v", - "lj": "lh", - "[sm]$": "", - "%L": "%V", - "(?P%V)pt": "$vt", - "(?P%C)er(?P%V)": "$cr$v" - } + "rules": [ + ["[sm]$", ""], + ["i(%V)", "j$1"], + ["%L", "%V"], + ["(%Vr)e$", "$1"], + ["(%V)v(%V)", "${1}$2"], + ["u$", "o"], + ["gn", "nh"], + ["(%V)p(%V)", "${1}b$2"], + ["(%V)t(%V)", "${1}d$2"], + ["(%V)c(%V)", "${1}g$2"], + ["(%F)ct", "${1}it"], + ["(%B)ct", "${1}ut"], + ["(%V)pt", "${1}t"], + ["ii", "i"], + ["(%C)er(%V)", "${1}r$2"], + ["lj", "lh"] + ] } #+END_SRC @@ -88,30 +92,94 @@ --- version: "1" categories: - Z: bgd - S: ptc - V: aeiou - F: ie - L: āēīōū B: ou + S: ptc + L: āēīōū + Z: bgd C: ptcqbdgmnlrhs + F: ie + V: aeiou rules: - "%L": "%V" - (?P%V)v(?P%V): $b$a - u$: o - "[sm]$": "" - gn: nh - (?P%F)ct: $fit - (?P%V)p(?P%V): $vb$a - ii: i - (?P%C)er(?P%V): $cr$v - lj: lh - (?P%Vr)e$: $v - (?P%V)c(?P%V): $bg$a - (?P%B)ct: $but - i(?P%V): j$v - (?P%V)t(?P%V): $bd$a - (?P%V)pt: $vt + - - "[sm]$" + - "" + - - i(%V) + - j$1 + - - "%L" + - "%V" + - - (%Vr)e$ + - $1 + - - (%V)v(%V) + - "${1}$2" + - - u$ + - o + - - gn + - nh + - - (%V)p(%V) + - "${1}b$2" + - - (%V)t(%V) + - "${1}d$2" + - - (%V)c(%V) + - "${1}g$2" + - - (%F)ct + - "${1}it" + - - (%B)ct + - "${1}ut" + - - (%V)pt + - "${1}t" + - - ii + - i + - - (%C)er(%V) + - "${1}r$2" + - - lj + - lh + #+END_SRC + + Although most of the rules are not between double quotes, it is preferable to + write them as follows in order to avoid any issues with LangEvolveRs: + #+BEGIN_SRC yaml + --- + version: "1" + categories: + B: ou + S: ptc + L: āēīōū + Z: bgd + C: ptcqbdgmnlrhs + F: ie + V: aeiou + rules: + - - "[sm]$" + - "" + - - "i(%V)" + - "j$1" + - - "%L" + - "%V" + - - "(%Vr)e$" + - "$1" + - - "(%V)v(%V)" + - "${1}$2" + - - "u$" + - "o" + - - "gn" + - "nh" + - - "(%V)p(%V)" + - "${1}b$2" + - - "(%V)t(%V)" + - "${1}d$2" + - - "(%V)c(%V)" + - "${1}g$2" + - - "(%F)ct" + - "${1}it" + - - "(%B)ct" + - "${1}ut" + - - "(%V)pt" + - "${1}t" + - - "ii" + - "i" + - - "(%C)er(%V)" + - "${1}r$2" + - - "lj" + - "lh" #+END_SRC You can find more information on how to use regular expressions with this