B
B
BadRabit2018-04-17 21:55:32
Python
BadRabit, 2018-04-17 21:55:32

Python data filtering?

Good afternoon!
I am writing a script for searching VK records by keywords. I ran into a problem, if our keyword is presented as a phrase, then we are given records where not all the phrases are in their entirety, but where there are its separate parts. For example: if the keyword is "our choice", then we are given records where there is the word "choice" and "our" and not all the phrases as a whole.
Question: is it possible to implement some kind of filter, so that only those records where the whole phrase is present would be issued?
Thank you.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
D
Dimonchik, 2018-04-17
@dimonchik2013

And what about Python? VK API see

A
Alexander, 2018-04-19
@sanya84

If I understand the question correctly

text = "Жизнь", "в Америке"

def search(data):
    print(" ".join(text))
    data = " ".join(text)
    if data == "Жизнь в Америке":
        return True
    else:
        return False

print(search(text))

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question