This is a test version of Biostars. For the public version, visit https://www.biostars.org.
match words from a file and then replace them with individual tokens in python

i have a text file with bigrams and ngrams, one bigram and ngram per line.what i want to do is to read each word from that file and then match that in original file. say i have a bigram "cricket match" .firstly,i have to take first word and will search that in original file if it matches then it will take second word. and will check where these 2 words occur together. and on those places where it occur together it will replace these 2 words as one term cricket match. i am not getting it,how i can do this.any help will be appreciated.

python programming

i am not getting it.how i can do this

Show what you've tried, and you could at least get some help. Biostars is not a coding service.

This will probably be closed if it’s not related to bioinformatics.

Hello aziyamehboob72!

We believe that this post does not fit the main topic of this site.

Insufficient effort made to show the relation to bioinformatics.

For this reason we have closed your question. This allows us to keep the site focused on the topics that the community can help with.

If you disagree please tell us why in a reply below, we'll be happy to talk about it.

Cheers!

0 answers

No answers yet.

Log in to answer this question.