Python code to filter phrases from a .txt file

In Progress Posted 2 years ago Paid on delivery
In Progress Paid on delivery

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.

Python Software Architecture Machine Learning (ML)

Project ID: #32368037

About the project

13 proposals Remote project Active 2 years ago

Awarded to:

azizullah444

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 More

$20 USD in 7 days
(8 Reviews)
3.4

13 freelancers are bidding on average $32 for this job

warlikedhruv

I can work in python3 with the given requirements , you can share more details of the work in chat.

$25 USD in 7 days
(19 Reviews)
3.9
cmoralesvasquez

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.

$50 USD in 7 days
(4 Reviews)
3.2
simonklemp

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 More

$90 USD in 1 day
(2 Reviews)
2.3
Timila2021

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 More

$20 USD in 1 day
(4 Reviews)
2.0
zydniinc

Hi there, I have gone through the complete description of your requirement. I am having 3+ years of experience in python, machine learning, and chatbot development. i can help you to rephrase function as per the descr More

$50 USD in 1 day
(2 Reviews)
1.7
palettesoft

Hello! I think I will can do this work. To solve this problem, you need to use filters, string operations and regular expressions.

$20 USD in 7 days
(0 Reviews)
0.0
abhishekkagautam

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 More

$28 USD in 2 days
(0 Reviews)
0.0
rakyas

i am a python expert and i have built several python applications ******************************************************************

$10 USD in 5 days
(0 Reviews)
0.0
khelifiaymen

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 More

$30 USD in 1 day
(0 Reviews)
0.0