Answered step by step
Verified Expert Solution
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 CS operating systems class,for I have not taken the CS class which is a prerequisite to CS nor have I taken the other prerequisite CS for the CS class,but I will take the CS class in this summer at SDSU, and I will take an equivalent class of CS in a community college this summer, so I will be able to take CS in the Fall semester.
Using regular expressions, write a python 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:
: I have good knowledge in using some operating systems
: I cannot take the CS operating systems class
: I have not taken the CS class which is a prerequisite to CS
: have I taken the other prerequisite CS for the CS class
: I will take the CS class in this summer at SDSU
: I will take an equivalent class of CS in a community college this summer
: I will be able to take CS 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
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started