Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Hello please writre code below. FANBOYS is an acronym that stands for for, and, nor, but, or , yet, and so , and they can

Hello please writre code below. FANBOYS is an acronym that stands for for, and, nor, but, or, yet, and so, and they can be used as coordinating conjunctions to join independent clauses into one compound sentence.
Below is the basic structure of a compound sentence created from joining two independent clauses by using a comma, followed by an optional whitespace (meaning the whitespace may or may not be there), and a coordinating conjunction:
Subject + verb + object, [coordinating conjunction] subject + verb + object.
Here is an example of a compound sentence composed of multiple independent clauses:
I have good knowledge in using some operating systems, yet I cannot take the CS480 operating systems class,for I have not taken the CS210 class which is a prerequisite to CS480, nor have I taken the other prerequisite CS370 for the CS480 class,but I will take the CS370 class in this summer at SDSU, and I will take an equivalent class of CS210 in a community college this summer, so I will be able to take CS480 in the Fall semester.
Using regular expressions, write a python 3 program to parse a compound sentence and separate it into multiple independent clauses by removing the FANBOYS conjunctions. With the above compound sentence example as the input, the output should be:
1: I have good knowledge in using some operating systems
2: I cannot take the CS480 operating systems class
3: I have not taken the CS210 class which is a prerequisite to CS480
4: have I taken the other prerequisite CS370 for the CS480 class
5: I will take the CS370 class in this summer at SDSU
6: I will take an equivalent class of CS210 in a community college this summer
7: I will be able to take CS480 in the Fall semester.
Note that you do not need to capitalize the beginnings of clauses, nor should you change them in other ways after separation, you just have to separate the clauses by coordinating conjunctions.
Hint: Use import re (re Regular expression operations)

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Intelligent Databases Technologies And Applications

Authors: Zongmin Ma

1st Edition

1599041219, 978-1599041216

More Books

Students also viewed these Databases questions