Question: How can I write function alice / 1 in SWI - Prolog to read in the alice.txt corpus, replace r with space, convert to

How can I write function alice/1 in SWI-Prolog to read in the alice.txt corpus, replace \r
with space, convert to lowercase, replace all punctuation with space, break into words, and return the list of words? I keep attempting different solutions but none of them work. Punctuation should be defined as [^a-zA-Z].

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!