ibus-table/fix-ipa-x-sampa-table-and-phrases-containing-spaces.patch
Mike FABIAN cbfd09b0fb Resolves: #856903
- Fix ipa-x-sampa table and phrases containing spaces in emoji-table
  Currently there is a regular expression which filters out several
  lines defining valid phrases. The emoji-table for example has phrases
  containing spaces which are currently filtered out and the ipa-x-sampa
  table has trailing comments which are filtered out as well.
2012-09-13 15:44:53 +02:00

43 lines
1.7 KiB
Diff

From 9d8a7228fca7615b8a3b7f74f7bf8cfe7861fe8b Mon Sep 17 00:00:00 2001
From: Mike FABIAN <mfabian@redhat.com>
Date: Thu, 13 Sep 2012 15:32:10 +0200
Subject: [PATCH] Fix ipa-x-sampa table and phrases containing spaces in
emoji-table
Currently there is a regular expression which filters out several
lines defining valid phrases. The emoji-table for example has phrases
containing spaces which are currently filtered out and the ipa-x-sampa
table has trailing comments which are filtered out as well.
In phrase_parser, the phrases are parsed like:
xingma, phrase, freq = unicode (l, "utf-8").strip ().split ('\t')[:3]
Therefore, it seems reasonable to change the regular expression checking
for a table line containing a phrase definition to accept every
line which has 3 columns seperated by tabs followed optionally
by more columns also separated by tabs (the optional columns are ignored,
i.e. they are just comments in the table source).
See: https://bugzilla.redhat.com/show_bug.cgi?id=856903
---
engine/tabcreatedb.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/engine/tabcreatedb.py b/engine/tabcreatedb.py
index 5b4a359..c644660 100644
--- a/engine/tabcreatedb.py
+++ b/engine/tabcreatedb.py
@@ -125,7 +125,7 @@ def main ():
patt_com = re.compile(r'^###.*')
patt_blank = re.compile(r'^[ \t]*$')
patt_conf = re.compile(r'[^\t]*=[^\t]*')
- patt_table = re.compile(r' *([^\s]+) *\t *([^\s]+)\t *[^\s]+ *$')
+ patt_table = re.compile(r'([^\t]+)\t([^\t]+)\t([^t]+)(\t.*)?$')
patt_gouci = re.compile(r' *[^\s]+ *\t *[^\s]+ *$')
patt_s = re.compile(r' *([^\s]+) *\t *([\x00-\xff]{3}) *\t *[^\s]+ *$')
--
1.7.11.4