Skip to content

Commit 1c97840

Browse files
committed
update README (rules)
1 parent 03d7710 commit 1c97840

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

README.adoc

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,16 @@ map:
125125
"\u0412": "V"
126126
----
127127

128+
=== Rules
129+
130+
The subsection `rules` is placed in the `map` section. All rules are applied in order they are placed before the subsection `characters` applying. Rules apply to an original text, not to a result of previous rules applying.
131+
132+
Each rule has `pattern` and `result` elements.
133+
134+
Pattern is a regex expression. It should be representing as a string without `//` or `%r{}` parentheses. For example `\b\u0415`. In case a rule is depend on previous or next content, lookahead or lookbehind could be used. For example a rule with the pattern `(?<=[АаЕеЁёИиОоУуЫыЭэЮюЯяЙйЪъЬь])\u0415` find every Е after upper or lower case symbols a, e, ё, и, о, у, ы, э, ю, я, й, ъ, ь.
135+
136+
Result is a replacement a for pattrn's match. It can contain a string, an Unicode characters specified by a hexadecimal number, a captured group reference. String with hexadecimal number or captured group reference should be double quoted. For example `"Y\u00eb"` or `"\\1\u00b7\\2"`. Captured group are reffered by double backslash and group's number.
137+
128138
=== Testing transliteration systems
129139

130140
To test all transliteration systems in `maps` direcrory run a command:

0 commit comments

Comments
 (0)