From 2508b90ce991e9217240db93479a5ff4788999c4 Mon Sep 17 00:00:00 2001 From: John Mager Date: Sun, 21 Jun 2020 03:31:23 +0000 Subject: [PATCH] Fixes bug in potentially cyclic ligatures * fixes issue #133 --- Scripts/features.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Scripts/features.py b/Scripts/features.py index 6117c2d..38c9583 100644 --- a/Scripts/features.py +++ b/Scripts/features.py @@ -53,6 +53,12 @@ def rule(liga): ignore(head=liga[0], suffix=(liga[1:] + [liga[-1]])), ] + # careful with repeats: + # #133 ->->->->, /**/**/**/, etc. + if len(liga) > 2 and liga[0] == liga[-1]: + rules.append(ignore([liga[-2]], liga[0], liga[1:])) + rules.append(ignore(head=liga[0], suffix=(liga[1:] + [liga[1]]))) + # hardcoded ignores, i.e. `<||>` rules.extend(ignores[tuple(liga)])