Skip to content

Instantly share code, notes, and snippets.

@tvirolai
Created September 20, 2017 10:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tvirolai/e3f924477b1b4bbe43c70fb9af35c595 to your computer and use it in GitHub Desktop.
Save tvirolai/e3f924477b1b4bbe43c70fb9af35c595 to your computer and use it in GitHub Desktop.
// Info: Käsitellään 248
248$g | <I48$G | S; RegReplaceTable('roomalaiset-arabialaisiksi.tbl')
248$h | <I48$H | S
248$b | <I48$B | S
248$r | <I48$R | S
248$c | <I48$C | S
248$d | <I48$D | S
248$e | <I48$E | If (Exists($d)) Then S
248$e | <I48$D | If (Not Exists($d)) Then S
I48 | 245 | D + S;
// Info: 248:ssa $D:
If (Exists(@245$d)) Then ReplaceOcc ('$D' By ' ; ', '>1', Strict) Else ReplaceOcc ('$D' By ' / ', '>1', Strict);
RegReplace ('($D.*)$B', '\\1 : ', 'g');
RegReplace ('($D.*)$R', '\\1 = ', 'g');
RegReplace ('($D.*)$C', '\\1. ', 'g');
If (Exists(@245$d) Or Exists(@248$d)) Then
{
while (RegFind ('$D.*$E') >= 0)
{
RegReplace ('($D.*)$E', '\\1 ; ', 'g');
};
}
Else
{
while (RegFind ('$D.*$E') >= 0)
{
RegReplace ('($D.*)$E', '\\1 / ', 'g');
};
}
// Info: Jos $n/$p on ennen $b:tä tai $b:tä ei ole, siirretään $n/$p $a:n perään
If (RegFind('$b.*$[np]') < 0) MoveAfter('np', $a, 'np', '', '', ' : | / | ; |. | = ');
// Info: G:n (n) ja H:n (p) välimerkit
Replace ('$G' By '.$G', Strict);
// Info: Siirretään g ja h oikeille paikoille
If (PreviousSub(@245$n, '>=1') != 'c' And PreviousSub(@245$p, '>=1') != 'c' And ExistsIn(S, $c)) MoveBefore('GH', $c, 'np', '', '', ' :| /| ;|.| =', 'BR');
If ((Not ExistsIn(S, $n)) And (Not ExistsIn(S, $p)) And (Not ExistsIn(S, $b))) MoveAfter('GH', $a, 'np', '', '', ' :| /| ;|.| =', 'BR');
Replace ('$G' By '$n');
Replace ('$H' By '$p');
If (ExistsIn(S, $c))
{
If (Exists(@245$d)) Then Replace ('$D' By ' ; ', Strict) Else Replace ('$D' By ' / ', Strict);
}
Else Replace ('$D' By ' /$c', Strict);
If (Not ExistsIn(S, $b)) ReplaceOcc ('$B' By ' :$b', '=1', Strict);
If (Not ExistsIn(S, $b)) ReplaceOcc ('$R' By ' :$b', '=1', Strict);
Replace ('$B' By ' : ', Strict);
Replace ('$R' By ' = ', Strict);
Replace ('$C' By '. ', Strict);
If (ExistsIn(S, $b)) MoveBefore('h', $b, 'h', '', '', ' :| /| ;|.| =') Else If (ExistsIn(S, $c)) MoveBefore('h', $c, 'h', '', '', ' :| /| ;|.| =');
For (OCC From 1 To 3) While (PreviousSubIn(S, $n, '=OCC') = 'c' Or PreviousSubIn(S, $p, '=OCC') = 'c') {
If (PreviousSubIn(S, $p, '=OCC') = 'c') {
If (RegFind(S, '$c.*\\.$') < 0) ReplaceOcc('$p' By '. ', '=OCC', Strict) Else ReplaceOcc('$p' By ' ', '=OCC', Strict);
}
Else ReplaceOcc('$p' By ', ', '=OCC', Strict);
If (RegFind(S, '$c.*\\.$') < 0) ReplaceOcc('$n' By '. ', '=OCC', Strict) Else ReplaceOcc('$n' By ' ', '=OCC', Strict);
};
RegReplaceTable('pieni-isoksi-osakentan-alussa.tbl')
Z48 | 245 | If (RegFind(D, '\\.\$') < 0) D + S Else D;
Pvalimerkitys();
// ***245+248 PÄÄTTYY TÄHÄN***
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment