V
V
Vlad2017-03-01 23:07:42
Parsing
Vlad, 2017-03-01 23:07:42

How to compare 2 texts and find unique words?

Is there a tool that can compare 2 texts and write out unique words, i.e. that repeat only 1 time?
it is desirable to convert all words to the initial form, but not necessarily
for example
text1: masha ate porridge
text2: masha ate soup
the tool should compare 2 texts and write out the words:
porridge
soup

Answer the question

In order to leave comments, you need to log in

3 answer(s)
X
xmoonlight, 2017-03-02
@xmoonlight

1. You need to break 2 texts into separate words and sort.
2. Search for similar ones in one and the other text, and if there is such, immediately exclude the words of these texts from the two arrays.
3. Remaining in arrays - will be unique ("non-intersecting") for the given two texts.
Similar words (strings) - can be found using a fuzzy search PHP script or try to order the right software for this task from them right away.

S
sim3x, 2017-03-02
@sim3x

In [1]: t1 = "маша ела кашу"

In [2]: t2 = "маша ела суп"

In [3]: set(t1.lower().split()) ^ set(t2.lower().split())
Out[3]: {'кашу', 'суп'}

+
https://pypi.python.org/pypi/normalizr/0.1.8

R
RuWeb, 2020-02-16
@RuWeb

Here is the service https://textcompare.ru/

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question