Skip to content

Instantly share code, notes, and snippets.

View roddar92's full-sized avatar

Dashka Rodionova roddar92

View GitHub Profile
@roddar92
roddar92 / Soundex.py
Created May 15, 2019 14:21
Phonetic algorithm for Russian and English languages based on Soundex
import re
from abc import ABC, abstractmethod
import editdistance
import pymorphy2
class Soundex(ABC):
_vowels = ''
_table = str.maketrans('', '')
_reduce_regex = re.compile(r'(\w)(\1)+', re.IGNORECASE)
@roddar92
roddar92 / translit.py
Last active October 11, 2022 14:08
Transliteration from Russian <-> English
# -*- coding: utf-8 -*-
import re
import string
from src.russian.NaiveTokenizer import NaiveTokenizer
from src.russian.SpellChecker import StatisticalSpeller
class Transliterator: