Start work on porting unicode input kitten to Go

This commit is contained in:
Kovid Goyal
2023-02-14 21:33:21 +05:30
parent a2e4efbb14
commit 53e33a80ba
20 changed files with 39037 additions and 76658 deletions
-22
View File
@@ -1,22 +0,0 @@
#!/usr/bin/env python3
# License: GPL v3 Copyright: 2018, Kovid Goyal <kovid at kovidgoyal.net>
from . import BaseTest
class TestUnicodeInput(BaseTest):
def test_word_trie(self):
from kittens.unicode_input.unicode_names import codepoints_for_word
def matches(a, *words):
ans = codepoints_for_word(a)
for w in words:
ans &= codepoints_for_word(w)
return set(ans)
self.ae(matches('horiz', 'ell'), {0x2026, 0x22ef, 0x2b2c, 0x2b2d, 0xfe19})
self.ae(matches('horizontal', 'ell'), {0x2026, 0x22ef, 0x2b2c, 0x2b2d, 0xfe19})
self.assertFalse(matches('sfgsfgsfgfgsdg'))
self.assertIn(0x1f41d, matches('bee'))