Quantcast
Channel: User Graygood - Stack Overflow
Viewing all articles
Browse latest Browse all 32

Generate multiple OR/AND statements [duplicate]

$
0
0

I am working on python script that splits text in different blocks based on keywords used in text.

Currently I split text into blocks with sth like this (for 1 block, others have pretty much the same strucure):

       if (line.strip().lower().startswith('ключевыенавыки')         or line.strip().lower().startswith('дополнительнаяинформация')         or line.strip().lower().startswith('знания')         or line.strip().lower().startswith('личныекачества')         or line.strip().lower().startswith('профессиональныенавыки')        or line.strip().lower().startswith('навыки')):

But, it is possible that list of keywords is going to expand. Is there a possibility to generate multiple or statements based on some array of possible keywords?


Viewing all articles
Browse latest Browse all 32

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>