Grammalecte  Hex Artifact Content

Artifact e5dd8880c38299bc1abbd476240443fc827cefc72afa58c1c2f8203b13d77a97:


0000: 23 20 6c 69 73 74 20 6f 66 20 73 69 6d 69 6c 61  # list of simila
0010: 72 20 63 68 61 72 73 0a 23 20 75 73 65 66 75 6c  r chars.# useful
0020: 20 66 6f 72 20 73 75 67 67 65 73 74 69 6f 6e 20   for suggestion 
0030: 6d 65 63 68 61 6e 69 73 6d 0a 0a 0a 64 65 66 20  mechanism...def 
0040: 64 69 73 74 61 6e 63 65 44 61 6d 65 72 61 75 4c  distanceDamerauL
0050: 65 76 65 6e 73 68 74 65 69 6e 20 28 73 31 2c 20  evenshtein (s1, 
0060: 73 32 29 3a 0a 20 20 20 20 22 64 69 73 74 61 6e  s2):.    "distan
0070: 63 65 20 6f 66 20 44 61 6d 65 72 61 75 2d 4c 65  ce of Damerau-Le
0080: 76 65 6e 73 68 74 65 69 6e 20 62 65 74 77 65 65  venshtein betwee
0090: 6e 20 3c 73 31 3e 20 61 6e 64 20 3c 73 32 3e 22  n <s1> and <s2>"
00a0: 0a 20 20 20 20 23 20 68 74 74 70 73 3a 2f 2f 66  .    # https://f
00b0: 72 2e 77 69 6b 69 70 65 64 69 61 2e 6f 72 67 2f  r.wikipedia.org/
00c0: 77 69 6b 69 2f 44 69 73 74 61 6e 63 65 5f 64 65  wiki/Distance_de
00d0: 5f 44 61 6d 65 72 61 75 2d 4c 65 76 65 6e 73 68  _Damerau-Levensh
00e0: 74 65 69 6e 0a 20 20 20 20 64 20 3d 20 7b 7d 0a  tein.    d = {}.
00f0: 20 20 20 20 6e 4c 65 6e 31 20 3d 20 6c 65 6e 28      nLen1 = len(
0100: 73 31 29 0a 20 20 20 20 6e 4c 65 6e 32 20 3d 20  s1).    nLen2 = 
0110: 6c 65 6e 28 73 32 29 0a 20 20 20 20 66 6f 72 20  len(s2).    for 
0120: 69 20 69 6e 20 72 61 6e 67 65 28 2d 31 2c 20 6e  i in range(-1, n
0130: 4c 65 6e 31 2b 31 29 3a 0a 20 20 20 20 20 20 20  Len1+1):.       
0140: 20 64 5b 69 2c 20 2d 31 5d 20 3d 20 69 20 2b 20   d[i, -1] = i + 
0150: 31 0a 20 20 20 20 66 6f 72 20 6a 20 69 6e 20 72  1.    for j in r
0160: 61 6e 67 65 28 2d 31 2c 20 6e 4c 65 6e 32 2b 31  ange(-1, nLen2+1
0170: 29 3a 0a 20 20 20 20 20 20 20 20 64 5b 2d 31 2c  ):.        d[-1,
0180: 20 6a 5d 20 3d 20 6a 20 2b 20 31 0a 20 20 20 20   j] = j + 1.    
0190: 66 6f 72 20 69 20 69 6e 20 72 61 6e 67 65 28 6e  for i in range(n
01a0: 4c 65 6e 31 29 3a 0a 20 20 20 20 20 20 20 20 66  Len1):.        f
01b0: 6f 72 20 6a 20 69 6e 20 72 61 6e 67 65 28 6e 4c  or j in range(nL
01c0: 65 6e 32 29 3a 0a 20 20 20 20 20 20 20 20 20 20  en2):.          
01d0: 20 20 6e 43 6f 73 74 20 3d 20 30 20 20 69 66 20    nCost = 0  if 
01e0: 73 31 5b 69 5d 20 3d 3d 20 73 32 5b 6a 5d 20 20  s1[i] == s2[j]  
01f0: 65 6c 73 65 20 31 0a 20 20 20 20 20 20 20 20 20  else 1.         
0200: 20 20 20 64 5b 69 2c 20 6a 5d 20 3d 20 6d 69 6e     d[i, j] = min
0210: 28 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20  (.              
0220: 20 20 64 5b 69 2d 31 2c 20 6a 5d 20 20 20 2b 20    d[i-1, j]   + 
0230: 31 2c 20 20 20 20 20 20 20 20 23 20 44 65 6c 65  1,        # Dele
0240: 74 69 6f 6e 0a 20 20 20 20 20 20 20 20 20 20 20  tion.           
0250: 20 20 20 20 20 64 5b 69 2c 20 20 20 6a 2d 31 5d       d[i,   j-1]
0260: 20 2b 20 31 2c 20 20 20 20 20 20 20 20 23 20 49   + 1,        # I
0270: 6e 73 65 72 74 69 6f 6e 0a 20 20 20 20 20 20 20  nsertion.       
0280: 20 20 20 20 20 20 20 20 20 64 5b 69 2d 31 2c 20           d[i-1, 
0290: 6a 2d 31 5d 20 2b 20 6e 43 6f 73 74 2c 20 20 20  j-1] + nCost,   
02a0: 20 23 20 53 75 62 73 74 69 74 75 74 69 6f 6e 0a   # Substitution.
02b0: 20 20 20 20 20 20 20 20 20 20 20 20 29 0a 20 20              ).  
02c0: 20 20 20 20 20 20 20 20 20 20 69 66 20 69 20 61            if i a
02d0: 6e 64 20 6a 20 61 6e 64 20 73 31 5b 69 5d 20 3d  nd j and s1[i] =
02e0: 3d 20 73 32 5b 6a 2d 31 5d 20 61 6e 64 20 73 31  = s2[j-1] and s1
02f0: 5b 69 2d 31 5d 20 3d 3d 20 73 32 5b 6a 5d 3a 0a  [i-1] == s2[j]:.
0300: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                  
0310: 64 5b 69 2c 20 6a 5d 20 3d 20 6d 69 6e 28 64 5b  d[i, j] = min(d[
0320: 69 2c 20 6a 5d 2c 20 64 5b 69 2d 32 2c 20 6a 2d  i, j], d[i-2, j-
0330: 32 5d 20 2b 20 6e 43 6f 73 74 29 20 20 20 20 20  2] + nCost)     
0340: 23 20 54 72 61 6e 73 70 6f 73 69 74 69 6f 6e 0a  # Transposition.
0350: 20 20 20 20 72 65 74 75 72 6e 20 64 5b 6e 4c 65      return d[nLe
0360: 6e 31 2d 31 2c 20 6e 4c 65 6e 32 2d 31 5d 0a 0a  n1-1, nLen2-1]..
0370: 0a 23 20 4d 65 74 68 6f 64 3a 20 52 65 6d 6f 76  .# Method: Remov
0380: 65 20 55 73 65 6c 65 73 73 20 43 68 61 72 73 0a  e Useless Chars.
0390: 0a 5f 64 56 6f 76 65 6c 73 20 3d 20 7b 0a 20 20  ._dVovels = {.  
03a0: 20 20 27 61 27 3a 20 27 27 2c 20 20 27 65 27 3a    'a': '',  'e':
03b0: 20 27 27 2c 20 20 27 69 27 3a 20 27 27 2c 20 20   '',  'i': '',  
03c0: 27 6f 27 3a 20 27 27 2c 20 20 27 75 27 3a 20 27  'o': '',  'u': '
03d0: 27 2c 20 20 27 79 27 3a 20 27 27 2c 0a 20 20 20  ',  'y': '',.   
03e0: 20 27 c3 a0 27 3a 20 27 27 2c 20 20 27 c3 a9 27   '..': '',  '..'
03f0: 3a 20 27 27 2c 20 20 27 c3 ae 27 3a 20 27 27 2c  : '',  '..': '',
0400: 20 20 27 c3 b4 27 3a 20 27 27 2c 20 20 27 c3 bb    '..': '',  '..
0410: 27 3a 20 27 27 2c 20 20 27 c3 bf 27 3a 20 27 27  ': '',  '..': ''
0420: 2c 0a 20 20 20 20 27 c3 a2 27 3a 20 27 27 2c 20  ,.    '..': '', 
0430: 20 27 c3 a8 27 3a 20 27 27 2c 20 20 27 c3 af 27   '..': '',  '..'
0440: 3a 20 27 27 2c 20 20 27 c3 b6 27 3a 20 27 27 2c  : '',  '..': '',
0450: 20 20 27 c3 b9 27 3a 20 27 27 2c 20 20 27 c5 b7    '..': '',  '..
0460: 27 3a 20 27 27 2c 0a 20 20 20 20 27 c3 a4 27 3a  ': '',.    '..':
0470: 20 27 27 2c 20 20 27 c3 aa 27 3a 20 27 27 2c 20   '',  '..': '', 
0480: 20 27 c3 ad 27 3a 20 27 27 2c 20 20 27 c3 b3 27   '..': '',  '..'
0490: 3a 20 27 27 2c 20 20 27 c3 bc 27 3a 20 27 27 2c  : '',  '..': '',
04a0: 20 20 27 c3 bd 27 3a 20 27 27 2c 0a 20 20 20 20    '..': '',.    
04b0: 27 c3 a1 27 3a 20 27 27 2c 20 20 27 c3 ab 27 3a  '..': '',  '..':
04c0: 20 27 27 2c 20 20 27 c3 ac 27 3a 20 27 27 2c 20   '',  '..': '', 
04d0: 20 27 c3 b2 27 3a 20 27 27 2c 20 20 27 c3 ba 27   '..': '',  '..'
04e0: 3a 20 27 27 2c 20 20 27 e1 bb b3 27 3a 20 27 27  : '',  '...': ''
04f0: 2c 0a 20 20 20 20 27 c4 81 27 3a 20 27 27 2c 20  ,.    '..': '', 
0500: 20 27 c4 93 27 3a 20 27 27 2c 20 20 27 c4 ab 27   '..': '',  '..'
0510: 3a 20 27 27 2c 20 20 27 c5 8d 27 3a 20 27 27 2c  : '',  '..': '',
0520: 20 20 27 c5 ab 27 3a 20 27 27 2c 20 20 27 c8 b3    '..': '',  '..
0530: 27 3a 20 27 27 2c 0a 20 20 20 20 27 68 27 3a 20  ': '',.    'h': 
0540: 27 27 2c 20 20 27 c5 93 27 3a 20 27 27 2c 20 20  '',  '..': '',  
0550: 27 c3 a6 27 3a 20 27 27 0a 20 7d 0a 0a 5f 78 54  '..': ''. }.._xT
0560: 72 61 6e 73 56 6f 76 65 6c 73 20 3d 20 73 74 72  ransVovels = str
0570: 2e 6d 61 6b 65 74 72 61 6e 73 28 5f 64 56 6f 76  .maketrans(_dVov
0580: 65 6c 73 29 0a 0a 0a 61 56 6f 76 65 6c 73 20 3d  els)...aVovels =
0590: 20 66 72 6f 7a 65 6e 73 65 74 28 5f 64 56 6f 76   frozenset(_dVov
05a0: 65 6c 73 2e 6b 65 79 73 28 29 29 0a 0a 0a 64 65  els.keys())...de
05b0: 66 20 63 6c 65 61 72 57 6f 72 64 20 28 73 57 6f  f clearWord (sWo
05c0: 72 64 29 3a 0a 20 20 20 20 22 72 65 6d 6f 76 65  rd):.    "remove
05d0: 20 76 6f 76 65 6c 73 20 61 6e 64 20 68 22 0a 20   vovels and h". 
05e0: 20 20 20 72 65 74 75 72 6e 20 73 57 6f 72 64 5b     return sWord[
05f0: 30 3a 31 5d 2e 72 65 70 6c 61 63 65 28 22 68 22  0:1].replace("h"
0600: 2c 20 22 22 29 20 2b 20 73 57 6f 72 64 5b 31 3a  , "") + sWord[1:
0610: 5d 2e 74 72 61 6e 73 6c 61 74 65 28 5f 78 54 72  ].translate(_xTr
0620: 61 6e 73 56 6f 76 65 6c 73 29 0a 0a 0a 23 20 53  ansVovels)...# S
0630: 69 6d 69 6c 61 72 20 63 68 61 72 73 0a 0a 64 31  imilar chars..d1
0640: 74 6f 31 20 3d 20 7b 0a 20 20 20 20 22 31 22 3a  to1 = {.    "1":
0650: 20 22 6c 69 c3 ae 4c 49 c3 8e 22 2c 0a 20 20 20   "li..LI..",.   
0660: 20 22 32 22 3a 20 22 7a 5a 22 2c 0a 20 20 20 20   "2": "zZ",.    
0670: 22 33 22 3a 20 22 65 c3 a9 c3 a8 c3 aa 45 c3 89  "3": "e......E..
0680: c3 88 c3 8a 22 2c 0a 20 20 20 20 22 34 22 3a 20  ....",.    "4": 
0690: 22 61 c3 a0 c3 a2 41 c3 80 c3 82 22 2c 0a 20 20  "a....A....",.  
06a0: 20 20 22 35 22 3a 20 22 73 67 53 47 22 2c 0a 20    "5": "sgSG",. 
06b0: 20 20 20 22 36 22 3a 20 22 62 64 67 42 44 47 22     "6": "bdgBDG"
06c0: 2c 0a 20 20 20 20 22 37 22 3a 20 22 6c 74 4c 54  ,.    "7": "ltLT
06d0: 22 2c 0a 20 20 20 20 22 38 22 3a 20 22 62 42 22  ",.    "8": "bB"
06e0: 2c 0a 20 20 20 20 22 39 22 3a 20 22 67 62 64 47  ,.    "9": "gbdG
06f0: 42 44 22 2c 0a 20 20 20 20 22 30 22 3a 20 22 6f  BD",.    "0": "o
0700: c3 b4 4f c3 94 22 2c 0a 0a 20 20 20 20 22 61 22  ..O..",..    "a"
0710: 3a 20 22 61 c3 a0 c3 a2 c3 a1 c3 a4 c3 a6 22 2c  : "a..........",
0720: 0a 20 20 20 20 22 41 22 3a 20 22 41 c3 80 c3 82  .    "A": "A....
0730: c3 81 c3 84 c3 86 22 2c 0a 20 20 20 20 22 c3 a0  ......",.    "..
0740: 22 3a 20 22 61 c3 a0 c3 a2 c3 a1 c3 a4 c3 a6 22  ": "a.........."
0750: 2c 0a 20 20 20 20 22 c3 80 22 3a 20 22 41 c3 80  ,.    "..": "A..
0760: c3 82 c3 81 c3 84 c3 86 22 2c 0a 20 20 20 20 22  ........",.    "
0770: c3 a2 22 3a 20 22 61 c3 a0 c3 a2 c3 a1 c3 a4 c3  ..": "a.........
0780: a6 22 2c 0a 20 20 20 20 22 c3 82 22 3a 20 22 41  .",.    "..": "A
0790: c3 80 c3 82 c3 81 c3 84 c3 86 22 2c 0a 20 20 20  ..........",.   
07a0: 20 22 c3 a1 22 3a 20 22 61 c3 a0 c3 a2 c3 a1 c3   "..": "a.......
07b0: a4 c3 a6 22 2c 0a 20 20 20 20 22 c3 81 22 3a 20  ...",.    "..": 
07c0: 22 41 c3 80 c3 82 c3 81 c3 84 c3 86 22 2c 0a 20  "A..........",. 
07d0: 20 20 20 22 c3 a4 22 3a 20 22 61 c3 a0 c3 a2 c3     "..": "a.....
07e0: a1 c3 a4 c3 a6 22 2c 0a 20 20 20 20 22 c3 84 22  .....",.    ".."
07f0: 3a 20 22 41 c3 80 c3 82 c3 81 c3 84 c3 86 22 2c  : "A..........",
0800: 0a 0a 20 20 20 20 22 c3 a6 22 3a 20 22 c3 a6 c3  ..    "..": "...
0810: a9 61 22 2c 0a 20 20 20 20 22 c3 86 22 3a 20 22  .a",.    "..": "
0820: c3 86 c3 89 41 22 2c 0a 0a 20 20 20 20 22 63 22  ....A",..    "c"
0830: 3a 20 22 63 c3 a7 73 6b 71 c5 9b c5 9d 22 2c 0a  : "c..skq....",.
0840: 20 20 20 20 22 43 22 3a 20 22 43 c3 87 53 4b 51      "C": "C..SKQ
0850: c5 9a c5 9c 22 2c 0a 20 20 20 20 22 c3 a7 22 3a  ....",.    "..":
0860: 20 22 63 c3 a7 73 6b 71 c5 9b c5 9d 22 2c 0a 20   "c..skq....",. 
0870: 20 20 20 22 c3 87 22 3a 20 22 43 c3 87 53 4b 51     "..": "C..SKQ
0880: c5 9a c5 9c 22 2c 0a 0a 20 20 20 20 22 65 22 3a  ....",..    "e":
0890: 20 22 65 c3 a9 c3 a8 c3 aa c3 ab c5 93 22 2c 0a   "e..........",.
08a0: 20 20 20 20 22 45 22 3a 20 22 45 c3 89 c3 88 c3      "E": "E.....
08b0: 8a c3 8b c5 92 22 2c 0a 20 20 20 20 22 c3 a9 22  .....",.    ".."
08c0: 3a 20 22 65 c3 a9 c3 a8 c3 aa c3 ab c5 93 22 2c  : "e..........",
08d0: 0a 20 20 20 20 22 c3 89 22 3a 20 22 45 c3 89 c3  .    "..": "E...
08e0: 88 c3 8a c3 8b c5 92 22 2c 0a 20 20 20 20 22 c3  .......",.    ".
08f0: aa 22 3a 20 22 65 c3 a9 c3 a8 c3 aa c3 ab c5 93  .": "e..........
0900: 22 2c 0a 20 20 20 20 22 c3 8a 22 3a 20 22 45 c3  ",.    "..": "E.
0910: 89 c3 88 c3 8a c3 8b c5 92 22 2c 0a 20 20 20 20  .........",.    
0920: 22 c3 a8 22 3a 20 22 65 c3 a9 c3 a8 c3 aa c3 ab  "..": "e........
0930: c5 93 22 2c 0a 20 20 20 20 22 c3 88 22 3a 20 22  ..",.    "..": "
0940: 45 c3 89 c3 88 c3 8a c3 8b c5 92 22 2c 0a 20 20  E..........",.  
0950: 20 20 22 c3 ab 22 3a 20 22 65 c3 a9 c3 a8 c3 aa    "..": "e......
0960: c3 ab c5 93 22 2c 0a 20 20 20 20 22 c3 8b 22 3a  ....",.    "..":
0970: 20 22 45 c3 89 c3 88 c3 8a c3 8b c5 92 22 2c 0a   "E..........",.
0980: 0a 20 20 20 20 22 67 22 3a 20 22 67 6a 22 2c 0a  .    "g": "gj",.
0990: 20 20 20 20 22 47 22 3a 20 22 47 4a 22 2c 0a 20      "G": "GJ",. 
09a0: 20 20 20 0a 20 20 20 20 22 69 22 3a 20 22 69 c3     .    "i": "i.
09b0: ae c3 af 79 c3 ad c3 ac c3 bf 22 2c 0a 20 20 20  ...y......",.   
09c0: 20 22 49 22 3a 20 22 49 c3 8e c3 8f 59 c3 8d c3   "I": "I....Y...
09d0: 8c c5 b8 22 2c 0a 20 20 20 20 22 c3 ae 22 3a 20  ...",.    "..": 
09e0: 22 69 c3 ae c3 af 79 c3 ad c3 ac c3 bf 22 2c 0a  "i....y......",.
09f0: 20 20 20 20 22 c3 8e 22 3a 20 22 49 c3 8e c3 8f      "..": "I....
0a00: 59 c3 8d c3 8c c5 b8 22 2c 0a 20 20 20 20 22 c3  Y......",.    ".
0a10: af 22 3a 20 22 69 c3 ae c3 af 79 c3 ad c3 ac c3  .": "i....y.....
0a20: bf 22 2c 0a 20 20 20 20 22 c3 8f 22 3a 20 22 49  .",.    "..": "I
0a30: c3 8e c3 8f 59 c3 8d c3 8c c5 b8 22 2c 0a 20 20  ....Y......",.  
0a40: 20 20 22 c3 ad 22 3a 20 22 69 c3 ae c3 af 79 c3    "..": "i....y.
0a50: ad c3 ac c3 bf 22 2c 0a 20 20 20 20 22 c3 8d 22  .....",.    ".."
0a60: 3a 20 22 49 c3 8e c3 8f 59 c3 8d c3 8c c5 b8 22  : "I....Y......"
0a70: 2c 0a 20 20 20 20 22 c3 ac 22 3a 20 22 69 c3 ae  ,.    "..": "i..
0a80: c3 af 79 c3 ad c3 ac c3 bf 22 2c 0a 20 20 20 20  ..y......",.    
0a90: 22 c3 8c 22 3a 20 22 49 c3 8e c3 8f 59 c3 8d c3  "..": "I....Y...
0aa0: 8c c5 b8 22 2c 0a 0a 20 20 20 20 22 6a 22 3a 20  ...",..    "j": 
0ab0: 22 6a 67 22 2c 0a 20 20 20 20 22 4a 22 3a 20 22  "jg",.    "J": "
0ac0: 4a 47 22 2c 0a 0a 20 20 20 20 22 6b 22 3a 20 22  JG",..    "k": "
0ad0: 6b 63 71 22 2c 0a 20 20 20 20 22 4b 22 3a 20 22  kcq",.    "K": "
0ae0: 4b 43 51 22 2c 0a 0a 20 20 20 20 22 6e 22 3a 20  KCQ",..    "n": 
0af0: 22 6e c3 b1 22 2c 0a 20 20 20 20 22 4e 22 3a 20  "n..",.    "N": 
0b00: 22 4e c3 91 22 2c 0a 0a 20 20 20 20 22 6f 22 3a  "N..",..    "o":
0b10: 20 22 6f c3 b4 c3 b3 c3 b2 c3 b6 c5 93 22 2c 0a   "o..........",.
0b20: 20 20 20 20 22 4f 22 3a 20 22 4f c3 94 c3 93 c3      "O": "O.....
0b30: 92 c3 96 c5 92 22 2c 0a 20 20 20 20 22 c3 b4 22  .....",.    ".."
0b40: 3a 20 22 6f c3 b4 c3 b3 c3 b2 c3 b6 c5 93 22 2c  : "o..........",
0b50: 0a 20 20 20 20 22 c3 94 22 3a 20 22 4f c3 94 c3  .    "..": "O...
0b60: 93 c3 92 c3 96 c5 92 22 2c 0a 20 20 20 20 22 c3  .......",.    ".
0b70: b3 22 3a 20 22 6f c3 b4 c3 b3 c3 b2 c3 b6 c5 93  .": "o..........
0b80: 22 2c 0a 20 20 20 20 22 c3 93 22 3a 20 22 4f c3  ",.    "..": "O.
0b90: 94 c3 93 c3 92 c3 96 c5 92 22 2c 0a 20 20 20 20  .........",.    
0ba0: 22 c3 b2 22 3a 20 22 6f c3 b4 c3 b3 c3 b2 c3 b6  "..": "o........
0bb0: c5 93 22 2c 0a 20 20 20 20 22 c3 92 22 3a 20 22  ..",.    "..": "
0bc0: 4f c3 94 c3 93 c3 92 c3 96 c5 92 22 2c 0a 20 20  O..........",.  
0bd0: 20 20 22 c3 b6 22 3a 20 22 6f c3 b4 c3 b3 c3 b2    "..": "o......
0be0: c3 b6 c5 93 22 2c 0a 20 20 20 20 22 c3 96 22 3a  ....",.    "..":
0bf0: 20 22 4f c3 94 c3 93 c3 92 c3 96 c5 92 22 2c 0a   "O..........",.
0c00: 0a 20 20 20 20 22 c5 93 22 3a 20 22 c5 93 6f c3  .    "..": "..o.
0c10: b4 65 c3 a9 c3 a8 c3 aa c3 ab 22 2c 0a 20 20 20  .e........",.   
0c20: 20 22 c5 92 22 3a 20 22 c5 92 4f c3 94 45 c3 89   "..": "..O..E..
0c30: c3 88 c3 8a c3 8b 22 2c 0a 0a 20 20 20 20 22 71  ......",..    "q
0c40: 22 3a 20 22 71 63 6b 22 2c 0a 20 20 20 20 22 51  ": "qck",.    "Q
0c50: 22 3a 20 22 51 43 4b 22 2c 0a 0a 20 20 20 20 22  ": "QCK",..    "
0c60: 73 22 3a 20 22 73 c5 9b c5 9d 63 c3 a7 22 2c 0a  s": "s....c..",.
0c70: 20 20 20 20 22 53 22 3a 20 22 53 c5 9a c5 9c 43      "S": "S....C
0c80: c3 87 22 2c 0a 20 20 20 20 22 c5 9b 22 3a 20 22  ..",.    "..": "
0c90: 73 c5 9b c5 9d 63 c3 a7 22 2c 0a 20 20 20 20 22  s....c..",.    "
0ca0: c5 9a 22 3a 20 22 53 c5 9a c5 9c 43 c3 87 22 2c  ..": "S....C..",
0cb0: 0a 20 20 20 20 22 c5 9d 22 3a 20 22 73 c5 9b c5  .    "..": "s...
0cc0: 9d 63 c3 a7 22 2c 0a 20 20 20 20 22 c5 9c 22 3a  .c..",.    "..":
0cd0: 20 22 53 c5 9a c5 9c 43 c3 87 22 2c 0a 0a 20 20   "S....C..",..  
0ce0: 20 20 22 75 22 3a 20 22 75 c3 bb c3 b9 c3 bc c3    "u": "u.......
0cf0: ba 22 2c 0a 20 20 20 20 22 55 22 3a 20 22 55 c3  .",.    "U": "U.
0d00: 9b c3 99 c3 9c c3 9a 22 2c 0a 20 20 20 20 22 c3  .......",.    ".
0d10: bb 22 3a 20 22 75 c3 bb c3 b9 c3 bc c3 ba 22 2c  .": "u........",
0d20: 0a 20 20 20 20 22 c3 9b 22 3a 20 22 55 c3 9b c3  .    "..": "U...
0d30: 99 c3 9c c3 9a 22 2c 0a 20 20 20 20 22 c3 b9 22  .....",.    ".."
0d40: 3a 20 22 75 c3 bb c3 b9 c3 bc c3 ba 22 2c 0a 20  : "u........",. 
0d50: 20 20 20 22 c3 99 22 3a 20 22 55 c3 9b c3 99 c3     "..": "U.....
0d60: 9c c3 9a 22 2c 0a 20 20 20 20 22 c3 bc 22 3a 20  ...",.    "..": 
0d70: 22 75 c3 bb c3 b9 c3 bc c3 ba 22 2c 0a 20 20 20  "u........",.   
0d80: 20 22 c3 9c 22 3a 20 22 55 c3 9b c3 99 c3 9c c3   "..": "U.......
0d90: 9a 22 2c 0a 20 20 20 20 22 c3 ba 22 3a 20 22 75  .",.    "..": "u
0da0: c3 bb c3 b9 c3 bc c3 ba 22 2c 0a 20 20 20 20 22  ........",.    "
0db0: c3 9a 22 3a 20 22 55 c3 9b c3 99 c3 9c c3 9a 22  ..": "U........"
0dc0: 2c 0a 0a 20 20 20 20 22 76 22 3a 20 22 76 77 22  ,..    "v": "vw"
0dd0: 2c 0a 20 20 20 20 22 56 22 3a 20 22 56 57 22 2c  ,.    "V": "VW",
0de0: 0a 0a 20 20 20 20 22 77 22 3a 20 22 77 76 22 2c  ..    "w": "wv",
0df0: 0a 20 20 20 20 22 57 22 3a 20 22 57 56 22 2c 0a  .    "W": "WV",.
0e00: 0a 20 20 20 20 22 78 22 3a 20 22 78 63 6b 22 2c  .    "x": "xck",
0e10: 0a 20 20 20 20 22 58 22 3a 20 22 58 43 4b 22 2c  .    "X": "XCK",
0e20: 0a 0a 20 20 20 20 22 79 22 3a 20 22 79 c3 bf 69  ..    "y": "y..i
0e30: c3 ae c5 b7 c3 bd e1 bb b3 22 2c 0a 20 20 20 20  .........",.    
0e40: 22 59 22 3a 20 22 59 c5 b8 49 c3 8e c5 b6 c3 9d  "Y": "Y..I......
0e50: e1 bb b2 22 2c 0a 20 20 20 20 22 c3 bf 22 3a 20  ...",.    "..": 
0e60: 22 79 c3 bf 69 c3 ae c5 b7 c3 bd e1 bb b3 22 2c  "y..i.........",
0e70: 0a 20 20 20 20 22 c5 b8 22 3a 20 22 59 c5 b8 49  .    "..": "Y..I
0e80: c3 8e c5 b6 c3 9d e1 bb b2 22 2c 0a 20 20 20 20  .........",.    
0e90: 22 c5 b7 22 3a 20 22 79 c3 bf 69 c3 ae c5 b7 c3  "..": "y..i.....
0ea0: bd e1 bb b3 22 2c 0a 20 20 20 20 22 c5 b6 22 3a  ....",.    "..":
0eb0: 20 22 59 c5 b8 49 c3 8e c5 b6 c3 9d e1 bb b2 22   "Y..I........."
0ec0: 2c 0a 20 20 20 20 22 c3 bd 22 3a 20 22 79 c3 bf  ,.    "..": "y..
0ed0: 69 c3 ae c5 b7 c3 bd e1 bb b3 22 2c 0a 20 20 20  i.........",.   
0ee0: 20 22 c3 9d 22 3a 20 22 59 c5 b8 49 c3 8e c5 b6   "..": "Y..I....
0ef0: c3 9d e1 bb b2 22 2c 0a 20 20 20 20 22 e1 bb b3  .....",.    "...
0f00: 22 3a 20 22 79 c3 bf 69 c3 ae c5 b7 c3 bd e1 bb  ": "y..i........
0f10: b3 22 2c 0a 20 20 20 20 22 e1 bb b2 22 3a 20 22  .",.    "...": "
0f20: 59 c5 b8 49 c3 8e c5 b6 c3 9d e1 bb b2 22 2c 0a  Y..I.........",.
0f30: 0a 20 20 20 20 22 7a 22 3a 20 22 7a 73 22 2c 0a  .    "z": "zs",.
0f40: 20 20 20 20 22 5a 22 3a 20 22 5a 53 22 2c 0a 7d      "Z": "ZS",.}
0f50: 0a 0a 64 31 74 6f 58 20 3d 20 7b 0a 20 20 20 20  ..d1toX = {.    
0f60: 22 c3 a6 22 3a 20 28 22 61 65 22 2c 29 2c 0a 20  "..": ("ae",),. 
0f70: 20 20 20 22 c3 86 22 3a 20 28 22 41 45 22 2c 29     "..": ("AE",)
0f80: 2c 0a 20 20 20 20 22 62 22 3a 20 28 22 62 62 22  ,.    "b": ("bb"
0f90: 2c 29 2c 0a 20 20 20 20 22 42 22 3a 20 28 22 42  ,),.    "B": ("B
0fa0: 42 22 2c 29 2c 0a 20 20 20 20 22 63 22 3a 20 28  B",),.    "c": (
0fb0: 22 63 63 22 2c 20 22 73 73 22 2c 20 22 71 75 22  "cc", "ss", "qu"
0fc0: 2c 20 22 63 68 22 29 2c 0a 20 20 20 20 22 43 22  , "ch"),.    "C"
0fd0: 3a 20 28 22 43 43 22 2c 20 22 53 53 22 2c 20 22  : ("CC", "SS", "
0fe0: 51 55 22 2c 20 22 43 48 22 29 2c 0a 20 20 20 20  QU", "CH"),.    
0ff0: 22 c3 a7 22 3a 20 28 22 73 73 22 2c 20 22 63 63  "..": ("ss", "cc
1000: 22 2c 20 22 71 68 22 2c 20 22 63 68 22 29 2c 0a  ", "qh", "ch"),.
1010: 20 20 20 20 22 c3 87 22 3a 20 28 22 53 53 22 2c      "..": ("SS",
1020: 20 22 43 43 22 2c 20 22 51 48 22 2c 20 22 43 48   "CC", "QH", "CH
1030: 22 29 2c 0a 20 20 20 20 22 64 22 3a 20 28 22 64  "),.    "d": ("d
1040: 64 22 2c 29 2c 0a 20 20 20 20 22 44 22 3a 20 28  d",),.    "D": (
1050: 22 44 44 22 2c 29 2c 0a 20 20 20 20 22 66 22 3a  "DD",),.    "f":
1060: 20 28 22 66 66 22 2c 20 22 70 68 22 29 2c 0a 20   ("ff", "ph"),. 
1070: 20 20 20 22 46 22 3a 20 28 22 46 46 22 2c 20 22     "F": ("FF", "
1080: 50 48 22 29 2c 0a 20 20 20 20 22 67 22 3a 20 28  PH"),.    "g": (
1090: 22 67 75 22 2c 20 22 67 65 22 2c 20 22 67 67 22  "gu", "ge", "gg"
10a0: 2c 20 22 67 68 22 29 2c 0a 20 20 20 20 22 47 22  , "gh"),.    "G"
10b0: 3a 20 28 22 47 55 22 2c 20 22 47 45 22 2c 20 22  : ("GU", "GE", "
10c0: 47 47 22 2c 20 22 47 48 22 29 2c 0a 20 20 20 20  GG", "GH"),.    
10d0: 22 69 22 3a 20 28 22 69 69 22 2c 29 2c 0a 20 20  "i": ("ii",),.  
10e0: 20 20 22 49 22 3a 20 28 22 49 49 22 2c 29 2c 0a    "I": ("II",),.
10f0: 20 20 20 20 22 6a 22 3a 20 28 22 6a 6a 22 2c 20      "j": ("jj", 
1100: 22 64 6a 22 29 2c 0a 20 20 20 20 22 4a 22 3a 20  "dj"),.    "J": 
1110: 28 22 4a 4a 22 2c 20 22 44 4a 22 29 2c 0a 20 20  ("JJ", "DJ"),.  
1120: 20 20 22 6b 22 3a 20 28 22 71 75 22 2c 20 22 63    "k": ("qu", "c
1130: 6b 22 2c 20 22 63 68 22 2c 20 22 63 75 22 2c 20  k", "ch", "cu", 
1140: 22 6b 6b 22 2c 20 22 6b 68 22 29 2c 0a 20 20 20  "kk", "kh"),.   
1150: 20 22 4b 22 3a 20 28 22 51 55 22 2c 20 22 43 4b   "K": ("QU", "CK
1160: 22 2c 20 22 43 48 22 2c 20 22 43 55 22 2c 20 22  ", "CH", "CU", "
1170: 4b 4b 22 2c 20 22 4b 48 22 29 2c 0a 20 20 20 20  KK", "KH"),.    
1180: 22 6c 22 3a 20 28 22 6c 6c 22 2c 29 2c 0a 20 20  "l": ("ll",),.  
1190: 20 20 22 4c 22 3a 20 28 22 4c 4c 22 2c 29 2c 0a    "L": ("LL",),.
11a0: 20 20 20 20 22 6d 22 3a 20 28 22 6d 6d 22 2c 20      "m": ("mm", 
11b0: 22 6d 6e 22 29 2c 0a 20 20 20 20 22 4d 22 3a 20  "mn"),.    "M": 
11c0: 28 22 4d 4d 22 2c 20 22 4d 4e 22 29 2c 0a 20 20  ("MM", "MN"),.  
11d0: 20 20 22 6e 22 3a 20 28 22 6e 6e 22 2c 20 22 6e    "n": ("nn", "n
11e0: 6d 22 2c 20 22 6d 6e 22 29 2c 0a 20 20 20 20 22  m", "mn"),.    "
11f0: 4e 22 3a 20 28 22 4e 4e 22 2c 20 22 4e 4d 22 2c  N": ("NN", "NM",
1200: 20 22 4d 4e 22 29 2c 0a 20 20 20 20 22 6f 22 3a   "MN"),.    "o":
1210: 20 28 22 61 75 22 2c 20 22 65 61 75 22 2c 20 22   ("au", "eau", "
1220: 61 75 74 22 29 2c 0a 20 20 20 20 22 4f 22 3a 20  aut"),.    "O": 
1230: 28 22 41 55 22 2c 20 22 45 41 55 22 2c 20 22 41  ("AU", "EAU", "A
1240: 55 54 22 29 2c 0a 20 20 20 20 22 c5 93 22 3a 20  UT"),.    "..": 
1250: 28 22 6f 65 22 2c 20 22 65 75 22 29 2c 0a 20 20  ("oe", "eu"),.  
1260: 20 20 22 c5 92 22 3a 20 28 22 4f 45 22 2c 20 22    "..": ("OE", "
1270: 45 55 22 29 2c 0a 20 20 20 20 22 70 22 3a 20 28  EU"),.    "p": (
1280: 22 70 70 22 2c 20 22 70 68 22 29 2c 0a 20 20 20  "pp", "ph"),.   
1290: 20 22 50 22 3a 20 28 22 50 50 22 2c 20 22 50 48   "P": ("PP", "PH
12a0: 22 29 2c 0a 20 20 20 20 22 71 22 3a 20 28 22 71  "),.    "q": ("q
12b0: 75 22 2c 20 22 63 68 22 2c 20 22 63 71 22 2c 20  u", "ch", "cq", 
12c0: 22 63 6b 22 2c 20 22 6b 6b 22 29 2c 0a 20 20 20  "ck", "kk"),.   
12d0: 20 22 51 22 3a 20 28 22 51 55 22 2c 20 22 43 48   "Q": ("QU", "CH
12e0: 22 2c 20 22 43 51 22 2c 20 22 43 4b 22 2c 20 22  ", "CQ", "CK", "
12f0: 4b 4b 22 29 2c 0a 20 20 20 20 22 72 22 3a 20 28  KK"),.    "r": (
1300: 22 72 72 22 2c 29 2c 0a 20 20 20 20 22 52 22 3a  "rr",),.    "R":
1310: 20 28 22 52 52 22 2c 29 2c 0a 20 20 20 20 22 73   ("RR",),.    "s
1320: 22 3a 20 28 22 73 73 22 2c 20 22 73 68 22 29 2c  ": ("ss", "sh"),
1330: 0a 20 20 20 20 22 53 22 3a 20 28 22 53 53 22 2c  .    "S": ("SS",
1340: 20 22 53 48 22 29 2c 0a 20 20 20 20 22 74 22 3a   "SH"),.    "t":
1350: 20 28 22 74 74 22 2c 20 22 74 68 22 29 2c 0a 20   ("tt", "th"),. 
1360: 20 20 20 22 54 22 3a 20 28 22 54 54 22 2c 20 22     "T": ("TT", "
1370: 54 48 22 29 2c 0a 20 20 20 20 22 78 22 3a 20 28  TH"),.    "x": (
1380: 22 63 63 22 2c 20 22 63 74 22 2c 20 22 78 78 22  "cc", "ct", "xx"
1390: 29 2c 0a 20 20 20 20 22 58 22 3a 20 28 22 43 43  ),.    "X": ("CC
13a0: 22 2c 20 22 43 54 22 2c 20 22 58 58 22 29 2c 0a  ", "CT", "XX"),.
13b0: 20 20 20 20 22 7a 22 3a 20 28 22 73 73 22 2c 20      "z": ("ss", 
13c0: 22 7a 68 22 29 2c 0a 20 20 20 20 22 5a 22 3a 20  "zh"),.    "Z": 
13d0: 28 22 53 53 22 2c 20 22 5a 48 22 29 2c 0a 7d 0a  ("SS", "ZH"),.}.
13e0: 0a 64 32 74 6f 58 20 3d 20 7b 0a 20 20 20 20 22  .d2toX = {.    "
13f0: 61 6e 22 3a 20 28 22 65 6e 22 2c 29 2c 0a 20 20  an": ("en",),.  
1400: 20 20 22 41 4e 22 3a 20 28 22 45 4e 22 2c 29 2c    "AN": ("EN",),
1410: 0a 20 20 20 20 22 65 6e 22 3a 20 28 22 61 6e 22  .    "en": ("an"
1420: 2c 29 2c 0a 20 20 20 20 22 45 4e 22 3a 20 28 22  ,),.    "EN": ("
1430: 41 4e 22 2c 29 2c 0a 20 20 20 20 22 61 69 22 3a  AN",),.    "ai":
1440: 20 28 22 65 69 22 2c 20 22 c3 a9 22 2c 20 22 c3   ("ei", "..", ".
1450: a8 22 2c 20 22 c3 aa 22 2c 20 22 c3 ab 22 29 2c  .", "..", ".."),
1460: 0a 20 20 20 20 22 41 49 22 3a 20 28 22 45 49 22  .    "AI": ("EI"
1470: 2c 20 22 c3 89 22 2c 20 22 c3 88 22 2c 20 22 c3  , "..", "..", ".
1480: 8a 22 2c 20 22 c3 8b 22 29 2c 0a 20 20 20 20 22  .", ".."),.    "
1490: 65 69 22 3a 20 28 22 61 69 22 2c 20 22 c3 a9 22  ei": ("ai", ".."
14a0: 2c 20 22 c3 a8 22 2c 20 22 c3 aa 22 2c 20 22 c3  , "..", "..", ".
14b0: ab 22 29 2c 0a 20 20 20 20 22 45 49 22 3a 20 28  ."),.    "EI": (
14c0: 22 41 49 22 2c 20 22 c3 89 22 2c 20 22 c3 88 22  "AI", "..", ".."
14d0: 2c 20 22 c3 8a 22 2c 20 22 c3 8b 22 29 2c 0a 20  , "..", ".."),. 
14e0: 20 20 20 22 63 68 22 3a 20 28 22 73 68 22 2c 20     "ch": ("sh", 
14f0: 22 63 22 2c 20 22 73 73 22 29 2c 0a 20 20 20 20  "c", "ss"),.    
1500: 22 43 48 22 3a 20 28 22 53 48 22 2c 20 22 43 22  "CH": ("SH", "C"
1510: 2c 20 22 53 53 22 29 2c 0a 20 20 20 20 22 63 74  , "SS"),.    "ct
1520: 22 3a 20 28 22 78 22 2c 20 22 63 63 22 29 2c 0a  ": ("x", "cc"),.
1530: 20 20 20 20 22 43 54 22 3a 20 28 22 58 22 2c 20      "CT": ("X", 
1540: 22 43 43 22 29 2c 0a 20 20 20 20 22 6f 61 22 3a  "CC"),.    "oa":
1550: 20 28 22 6f 69 22 2c 29 2c 0a 20 20 20 20 22 4f   ("oi",),.    "O
1560: 41 22 3a 20 28 22 4f 49 22 2c 29 2c 0a 20 20 20  A": ("OI",),.   
1570: 20 22 6f 69 22 3a 20 28 22 6f 61 22 2c 20 22 6f   "oi": ("oa", "o
1580: 69 65 22 29 2c 0a 20 20 20 20 22 4f 49 22 3a 20  ie"),.    "OI": 
1590: 28 22 4f 41 22 2c 20 22 4f 49 45 22 29 2c 0a 20  ("OA", "OIE"),. 
15a0: 20 20 20 22 71 75 22 3a 20 28 22 71 22 2c 20 22     "qu": ("q", "
15b0: 63 71 22 2c 20 22 63 6b 22 2c 20 22 63 22 2c 20  cq", "ck", "c", 
15c0: 22 6b 22 29 2c 0a 20 20 20 20 22 51 55 22 3a 20  "k"),.    "QU": 
15d0: 28 22 51 22 2c 20 22 43 51 22 2c 20 22 43 4b 22  ("Q", "CQ", "CK"
15e0: 2c 20 22 43 22 2c 20 22 4b 22 29 2c 0a 20 20 20  , "C", "K"),.   
15f0: 20 22 73 73 22 3a 20 28 22 63 22 2c 20 22 c3 a7   "ss": ("c", "..
1600: 22 29 2c 0a 20 20 20 20 22 53 53 22 3a 20 28 22  "),.    "SS": ("
1610: 43 22 2c 20 22 c3 87 22 29 2c 0a 7d 0a 0a 0a 23  C", ".."),.}...#
1620: 20 45 6e 64 20 6f 66 20 77 6f 72 64 0a 0a 64 46   End of word..dF
1630: 69 6e 61 6c 31 20 3d 20 7b 0a 20 20 20 20 22 61  inal1 = {.    "a
1640: 22 3a 20 28 22 61 73 22 2c 20 22 61 74 22 2c 20  ": ("as", "at", 
1650: 22 61 6e 74 22 2c 20 22 61 68 22 29 2c 0a 20 20  "ant", "ah"),.  
1660: 20 20 22 41 22 3a 20 28 22 41 53 22 2c 20 22 41    "A": ("AS", "A
1670: 54 22 2c 20 22 41 4e 54 22 2c 20 22 41 48 22 29  T", "ANT", "AH")
1680: 2c 0a 20 20 20 20 22 63 22 3a 20 28 22 63 68 22  ,.    "c": ("ch"
1690: 2c 29 2c 0a 20 20 20 20 22 43 22 3a 20 28 22 43  ,),.    "C": ("C
16a0: 48 22 2c 29 2c 0a 20 20 20 20 22 65 22 3a 20 28  H",),.    "e": (
16b0: 22 65 74 22 2c 20 22 65 72 22 2c 20 22 65 74 73  "et", "er", "ets
16c0: 22 2c 20 22 c3 a9 65 22 2c 20 22 65 7a 22 2c 20  ", "..e", "ez", 
16d0: 22 61 69 22 2c 20 22 61 69 73 22 2c 20 22 61 69  "ai", "ais", "ai
16e0: 74 22 2c 20 22 65 6e 74 22 2c 20 22 65 68 22 29  t", "ent", "eh")
16f0: 2c 0a 20 20 20 20 22 45 22 3a 20 28 22 45 54 22  ,.    "E": ("ET"
1700: 2c 20 22 45 52 22 2c 20 22 45 54 53 22 2c 20 22  , "ER", "ETS", "
1710: c3 89 45 22 2c 20 22 45 5a 22 2c 20 22 41 49 22  ..E", "EZ", "AI"
1720: 2c 20 22 41 49 53 22 2c 20 22 41 49 54 22 2c 20  , "AIS", "AIT", 
1730: 22 45 4e 54 22 2c 20 22 45 48 22 29 2c 0a 20 20  "ENT", "EH"),.  
1740: 20 20 22 c3 a9 22 3a 20 28 22 65 74 22 2c 20 22    "..": ("et", "
1750: 65 72 22 2c 20 22 65 74 73 22 2c 20 22 c3 a9 65  er", "ets", "..e
1760: 22 2c 20 22 65 7a 22 2c 20 22 61 69 22 2c 20 22  ", "ez", "ai", "
1770: 61 69 73 22 2c 20 22 61 69 74 22 29 2c 0a 20 20  ais", "ait"),.  
1780: 20 20 22 c3 89 22 3a 20 28 22 45 54 22 2c 20 22    "..": ("ET", "
1790: 45 52 22 2c 20 22 45 54 53 22 2c 20 22 c3 89 45  ER", "ETS", "..E
17a0: 22 2c 20 22 45 5a 22 2c 20 22 41 49 22 2c 20 22  ", "EZ", "AI", "
17b0: 41 49 53 22 2c 20 22 41 49 54 22 29 2c 0a 20 20  AIS", "AIT"),.  
17c0: 20 20 22 c3 a8 22 3a 20 28 22 65 74 22 2c 20 22    "..": ("et", "
17d0: 65 72 22 2c 20 22 65 74 73 22 2c 20 22 c3 a9 65  er", "ets", "..e
17e0: 22 2c 20 22 65 7a 22 2c 20 22 61 69 22 2c 20 22  ", "ez", "ai", "
17f0: 61 69 73 22 2c 20 22 61 69 74 22 29 2c 0a 20 20  ais", "ait"),.  
1800: 20 20 22 c3 88 22 3a 20 28 22 45 54 22 2c 20 22    "..": ("ET", "
1810: 45 52 22 2c 20 22 45 54 53 22 2c 20 22 c3 89 45  ER", "ETS", "..E
1820: 22 2c 20 22 45 5a 22 2c 20 22 41 49 22 2c 20 22  ", "EZ", "AI", "
1830: 41 49 53 22 2c 20 22 41 49 54 22 29 2c 0a 20 20  AIS", "AIT"),.  
1840: 20 20 22 c3 aa 22 3a 20 28 22 65 74 22 2c 20 22    "..": ("et", "
1850: 65 72 22 2c 20 22 65 74 73 22 2c 20 22 c3 a9 65  er", "ets", "..e
1860: 22 2c 20 22 65 7a 22 2c 20 22 61 69 22 2c 20 22  ", "ez", "ai", "
1870: 61 69 73 22 2c 20 22 61 69 74 22 29 2c 0a 20 20  ais", "ait"),.  
1880: 20 20 22 c3 8a 22 3a 20 28 22 45 54 22 2c 20 22    "..": ("ET", "
1890: 45 52 22 2c 20 22 45 54 53 22 2c 20 22 c3 89 45  ER", "ETS", "..E
18a0: 22 2c 20 22 45 5a 22 2c 20 22 41 49 22 2c 20 22  ", "EZ", "AI", "
18b0: 41 49 53 22 2c 20 22 41 49 54 22 29 2c 0a 20 20  AIS", "AIT"),.  
18c0: 20 20 22 c3 ab 22 3a 20 28 22 65 74 22 2c 20 22    "..": ("et", "
18d0: 65 72 22 2c 20 22 65 74 73 22 2c 20 22 c3 a9 65  er", "ets", "..e
18e0: 22 2c 20 22 65 7a 22 2c 20 22 61 69 22 2c 20 22  ", "ez", "ai", "
18f0: 61 69 73 22 2c 20 22 61 69 74 22 29 2c 0a 20 20  ais", "ait"),.  
1900: 20 20 22 c3 8b 22 3a 20 28 22 45 54 22 2c 20 22    "..": ("ET", "
1910: 45 52 22 2c 20 22 45 54 53 22 2c 20 22 c3 89 45  ER", "ETS", "..E
1920: 22 2c 20 22 45 5a 22 2c 20 22 41 49 22 2c 20 22  ", "EZ", "AI", "
1930: 41 49 53 22 2c 20 22 41 49 54 22 29 2c 0a 20 20  AIS", "AIT"),.  
1940: 20 20 22 67 22 3a 20 28 22 67 68 22 2c 29 2c 0a    "g": ("gh",),.
1950: 20 20 20 20 22 47 22 3a 20 28 22 47 48 22 2c 29      "G": ("GH",)
1960: 2c 0a 20 20 20 20 22 69 22 3a 20 28 22 69 73 22  ,.    "i": ("is"
1970: 2c 20 22 69 74 22 2c 20 22 69 65 22 2c 20 22 69  , "it", "ie", "i
1980: 6e 22 29 2c 0a 20 20 20 20 22 49 22 3a 20 28 22  n"),.    "I": ("
1990: 49 53 22 2c 20 22 49 54 22 2c 20 22 49 45 22 2c  IS", "IT", "IE",
19a0: 20 22 49 4e 22 29 2c 0a 20 20 20 20 22 6e 22 3a   "IN"),.    "n":
19b0: 20 28 22 6e 74 22 2c 20 22 6e 64 22 2c 20 22 6e   ("nt", "nd", "n
19c0: 73 22 2c 20 22 6e 68 22 29 2c 0a 20 20 20 20 22  s", "nh"),.    "
19d0: 4e 22 3a 20 28 22 4e 54 22 2c 20 22 4e 44 22 2c  N": ("NT", "ND",
19e0: 20 22 4e 53 22 2c 20 22 4e 48 22 29 2c 0a 20 20   "NS", "NH"),.  
19f0: 20 20 22 6f 22 3a 20 28 22 61 75 74 22 2c 20 22    "o": ("aut", "
1a00: 6f 74 22 2c 20 22 6f 73 22 29 2c 0a 20 20 20 20  ot", "os"),.    
1a10: 22 4f 22 3a 20 28 22 41 55 54 22 2c 20 22 4f 54  "O": ("AUT", "OT
1a20: 22 2c 20 22 4f 53 22 29 2c 0a 20 20 20 20 22 c3  ", "OS"),.    ".
1a30: b4 22 3a 20 28 22 61 75 74 22 2c 20 22 6f 74 22  .": ("aut", "ot"
1a40: 2c 20 22 6f 73 22 29 2c 0a 20 20 20 20 22 c3 94  , "os"),.    "..
1a50: 22 3a 20 28 22 41 55 54 22 2c 20 22 4f 54 22 2c  ": ("AUT", "OT",
1a60: 20 22 4f 53 22 29 2c 0a 20 20 20 20 22 c3 b6 22   "OS"),.    ".."
1a70: 3a 20 28 22 61 75 74 22 2c 20 22 6f 74 22 2c 20  : ("aut", "ot", 
1a80: 22 6f 73 22 29 2c 0a 20 20 20 20 22 c3 96 22 3a  "os"),.    "..":
1a90: 20 28 22 41 55 54 22 2c 20 22 4f 54 22 2c 20 22   ("AUT", "OT", "
1aa0: 4f 53 22 29 2c 0a 20 20 20 20 22 70 22 3a 20 28  OS"),.    "p": (
1ab0: 22 70 68 22 2c 29 2c 0a 20 20 20 20 22 50 22 3a  "ph",),.    "P":
1ac0: 20 28 22 50 48 22 2c 29 2c 0a 20 20 20 20 22 73   ("PH",),.    "s
1ad0: 22 3a 20 28 22 73 68 22 2c 29 2c 0a 20 20 20 20  ": ("sh",),.    
1ae0: 22 53 22 3a 20 28 22 53 48 22 2c 29 2c 0a 20 20  "S": ("SH",),.  
1af0: 20 20 22 74 22 3a 20 28 22 74 68 22 2c 29 2c 0a    "t": ("th",),.
1b00: 20 20 20 20 22 54 22 3a 20 28 22 54 48 22 2c 29      "T": ("TH",)
1b10: 2c 0a 20 20 20 20 22 75 22 3a 20 28 22 75 74 22  ,.    "u": ("ut"
1b20: 2c 20 22 75 73 22 2c 20 22 75 68 22 29 2c 0a 20  , "us", "uh"),. 
1b30: 20 20 20 22 55 22 3a 20 28 22 55 54 22 2c 20 22     "U": ("UT", "
1b40: 55 53 22 2c 20 22 55 48 22 29 2c 0a 7d 0a 0a 64  US", "UH"),.}..d
1b50: 46 69 6e 61 6c 32 20 3d 20 7b 0a 20 20 20 20 22  Final2 = {.    "
1b60: 61 69 22 3a 20 28 22 61 69 65 6e 74 22 2c 20 22  ai": ("aient", "
1b70: 61 69 73 22 2c 20 22 65 74 22 29 2c 0a 20 20 20  ais", "et"),.   
1b80: 20 22 41 49 22 3a 20 28 22 41 49 45 4e 54 22 2c   "AI": ("AIENT",
1b90: 20 22 41 49 53 22 2c 20 22 45 54 22 29 2c 0a 20   "AIS", "ET"),. 
1ba0: 20 20 20 22 61 6e 22 3a 20 28 22 61 6e 74 22 2c     "an": ("ant",
1bb0: 20 22 65 6e 74 22 29 2c 0a 20 20 20 20 22 41 4e   "ent"),.    "AN
1bc0: 22 3a 20 28 22 41 4e 54 22 2c 20 22 45 4e 54 22  ": ("ANT", "ENT"
1bd0: 29 2c 0a 20 20 20 20 22 65 6e 22 3a 20 28 22 65  ),.    "en": ("e
1be0: 6e 74 22 2c 20 22 61 6e 74 22 29 2c 0a 20 20 20  nt", "ant"),.   
1bf0: 20 22 45 4e 22 3a 20 28 22 45 4e 54 22 2c 20 22   "EN": ("ENT", "
1c00: 41 4e 54 22 29 2c 0a 20 20 20 20 22 65 69 22 3a  ANT"),.    "ei":
1c10: 20 28 22 61 69 74 22 2c 20 22 61 69 73 22 29 2c   ("ait", "ais"),
1c20: 0a 20 20 20 20 22 45 49 22 3a 20 28 22 41 49 54  .    "EI": ("AIT
1c30: 22 2c 20 22 41 49 53 22 29 2c 0a 20 20 20 20 22  ", "AIS"),.    "
1c40: 6f 6e 22 3a 20 28 22 6f 6e 73 22 2c 20 22 6f 6e  on": ("ons", "on
1c50: 74 22 29 2c 0a 20 20 20 20 22 4f 4e 22 3a 20 28  t"),.    "ON": (
1c60: 22 4f 4e 53 22 2c 20 22 4f 4e 54 22 29 2c 0a 20  "ONS", "ONT"),. 
1c70: 20 20 20 22 6f 69 22 3a 20 28 22 6f 69 73 22 2c     "oi": ("ois",
1c80: 20 22 6f 69 74 22 2c 20 22 6f 69 78 22 29 2c 0a   "oit", "oix"),.
1c90: 20 20 20 20 22 4f 49 22 3a 20 28 22 4f 49 53 22      "OI": ("OIS"
1ca0: 2c 20 22 4f 49 54 22 2c 20 22 4f 49 58 22 29 2c  , "OIT", "OIX"),
1cb0: 0a 7d 0a 0a 0a 23 20 50 72 c3 a9 66 69 78 65 73  .}...# Pr..fixes
1cc0: 0a 0a 61 50 66 78 31 20 3d 20 66 72 6f 7a 65 6e  ..aPfx1 = frozen
1cd0: 73 65 74 28 5b 0a 20 20 20 20 22 61 6e 74 69 22  set([.    "anti"
1ce0: 2c 20 22 61 72 63 68 69 22 2c 20 22 63 6f 6e 74  , "archi", "cont
1cf0: 72 65 22 2c 20 22 68 79 70 65 72 22 2c 20 22 6d  re", "hyper", "m
1d00: c3 a9 22 2c 20 22 6d c3 a9 74 61 22 2c 20 22 69  ..", "m..ta", "i
1d10: 6d 22 2c 20 22 69 6e 22 2c 20 22 69 72 22 2c 20  m", "in", "ir", 
1d20: 22 70 61 72 22 2c 20 22 70 72 6f 74 6f 22 2c 0a  "par", "proto",.
1d30: 20 20 20 20 22 70 73 65 75 64 6f 22 2c 20 22 70      "pseudo", "p
1d40: 72 c3 a9 22 2c 20 22 72 65 22 2c 20 22 72 c3 a9  r..", "re", "r..
1d50: 22 2c 20 22 73 61 6e 73 22 2c 20 22 73 6f 75 73  ", "sans", "sous
1d60: 22 2c 20 22 73 75 70 72 61 22 2c 20 22 73 75 72  ", "supra", "sur
1d70: 22 2c 20 22 75 6c 74 72 61 22 0a 5d 29 0a 61 50  ", "ultra".]).aP
1d80: 66 78 32 20 3d 20 66 72 6f 7a 65 6e 73 65 74 28  fx2 = frozenset(
1d90: 5b 0a 20 20 20 20 22 62 65 6c 67 6f 22 2c 20 22  [.    "belgo", "
1da0: 66 72 61 6e 63 6f 22 2c 20 22 67 c3 a9 6e 69 74  franco", "g..nit
1db0: 6f 22 2c 20 22 67 79 6e c3 a9 63 6f 22 2c 20 22  o", "gyn..co", "
1dc0: 6d c3 a9 64 69 63 6f 22 2c 20 22 72 75 73 73 6f  m..dico", "russo
1dd0: 22 0a 5d 29 0a 0a 61 45 78 63 6c 75 64 65 64 53  ".])..aExcludedS
1de0: 66 78 20 3d 20 66 72 6f 7a 65 6e 73 65 74 28 5b  fx = frozenset([
1df0: 0a 20 20 20 20 22 6a 65 22 2c 20 22 74 75 22 2c  .    "je", "tu",
1e00: 20 22 69 6c 22 2c 20 22 65 6c 6c 65 22 2c 20 22   "il", "elle", "
1e10: 6f 6e 22 2c 20 22 74 2d 69 6c 22 2c 20 22 74 2d  on", "t-il", "t-
1e20: 65 6c 6c 65 22 2c 20 22 74 2d 6f 6e 22 2c 20 22  elle", "t-on", "
1e30: 6e 6f 75 73 22 2c 20 22 76 6f 75 73 22 2c 20 22  nous", "vous", "
1e40: 69 6c 73 22 2c 20 22 65 6c 6c 65 73 22 0a 5d 29  ils", "elles".])
1e50: 0a                                               .