У меня есть 2 похожие строки. Как найти наиболее вероятное выравнивание слов между этими двумя строками в Python?
Пример ввода:
string1 = 'my channel is youtube dot com slash example and then I also do live streaming on twitch.'
string2 = 'my channel is youtube.com/example and then I also do livestreaming on twitch.'
Желаемый результат:
alignment['my'] = 'my'
alignment['channel'] = 'channel'
alignment['is'] = 'is'
alignment['youtube'] = 'youtube.com/example'
alignment['dot'] = 'youtube.com/example'
alignment['com'] = 'youtube.com/example'
alignment['slash'] = 'youtube.com/example'
alignment['example'] = 'youtube.com/example'
alignment['and'] = 'and'
alignment['then'] = 'then'
alignment['I'] = 'I'
alignment['also'] = 'also'
alignment['do'] = 'do'
alignment['live'] = 'livestreaming'
alignment['streaming'] = 'livestreaming'
alignment['on'] = 'on'
alignment['twitch'] = 'twitch'
Подробнее здесь: https://stackoverflow.com/questions/731 ... -in-python
Найдите наиболее вероятное выравнивание слов между двумя строками в Python ⇐ Python
-
- Похожие темы
- Ответы
- Просмотры
- Последнее сообщение