Python code to filter phrases from a .txt file
$10-30 USD
Plačilo ob prevzemu
I need a code in python to search and replace words and filter phrases from a txt file based on its words.
There is a large file [login to view URL] with text like this:
Life is a characteristic that distinguishes physical entities that have biological process. Various forms of life exist, such as archaea, and bacteria. Biology is the science that studies life.
In this case we have 3 phrases in one paragraph:
1) Life is a characteristic that distinguishes physical entities that have biological process.
2) Various forms of life exist, such as archaea, and bacteria.
3) Biology is the science that studies life.
It means, a phrase is a group of words that ends with . ? or !
------------
We need 3 functions called f1, f2 and f3.
Function 1 (f1): search and replace
This function is basically to search and replace words. There is a file called [login to view URL] with words like this:
He's=He is
Yo=You
The code must find the word "He's" and replace with "He is" and so on for the other words.
It is case sensitive.
Search only for the entire word, for example, don't replace the word "Young" by "Youung".
The command line must be:
C:/user/.../python310: python [login to view URL] [login to view URL] [login to view URL] f1
Change and save the file [login to view URL] with the replacements.
Function 2 (f2) filter phrases
There is a file [login to view URL] with many words, like:
You
Me
To
Are
How
Day
And
This
Is
The code will filter only the phrases that all its words are in the [login to view URL] file. In this example the phrase "How are you?" achieved the criteria and "how are you doing?" do not, because the word doing is not listed.
The command line must be C:/user/.../python310: python [login to view URL] [login to view URL] [login to view URL] f2.
It creates the file [login to view URL]
This file must contain the list of phrases that achieved the criteria and with no repetition (don't list the same phrase twice).
Function 3 (f3): filter phrases
There is a file [login to view URL] with some words, like:
You
Do
Day
The code must filter the phrases that have at least one word from words_2.txt.
The phrase "did you know?" is ok, because the word "you" is in the file words_2.txt.
The phrase "this is me." is not ok, no one word is in the file [login to view URL]
The command line must be:
C:/user/.../python310: python [login to view URL] [login to view URL] [login to view URL] f3
It must create the file [login to view URL] with the phrases filtered.
Don't list the same phrase twice.
ID projekta: #32368037
Več o projektu
Dodeljeno:
Greetings Lucas! I have excellent skills regarding your project with over six years of experience. I'll developed a robust version which will work like a champ with huge text file. I'll use advance Regex. Acknowledg Več
13 freelancerjev ponuja v povprečju za $32 na tem delu
I can work in python3 with the given requirements , you can share more details of the work in chat.
Hello. As a senior full stack software engineer, I have rich experience with Python. I can solve you problem in a day. Please contact me. I am ready to start right now.
Hello, I read the description and I can do it. The price has to be adjusted as it is quite a bit of work, but you will get it delivered by today. I am a Computer Science Bachelor, currently enrolled in the Masters pro Več
Hi, I've read your description carefully. I have full experience with python I've also worked on several similar projects. So I can complete your project with high quality on time. Looking forward to hear more about th Več
Hello! I think I will can do this work. To solve this problem, you need to use filters, string operations and regular expressions.
Greeting I understand your problem statement clearly and I can a sure you that we will be able to do this task with in time limit of 2 days . I have tons of experience doing similar NLP problem solving if you want I d Več
i am a python expert and i have built several python applications ******************************************************************
Hello, I am Aymen. A technical consultant and an ICT engineer. I have developed several Business level application in my job and tried several things in my free time. I enjoy making AI based applications. In fact I ha Več