subject

Preparing text for the paradelle check. The poems that we aim to check are stored as values of type string in text files. But the read_file function above will return this data in a value of type char list option. We will need to break the input into a list of lines of text, removing the blank lines, and also splitting the lines of text into lists of words. We need to write a function called convert_to_non_blank_lines_of_words that takes as input the poem as an OCaml char list and returns a list of lines, where each line is a list of words, and each word is a list of characters. Thus, convert_to_non_blank_lines_of_words can be seen as having the type char list -> char list list list. We can use the type system to name new types that make this type easier to read. First define the type word to be char list by type word = char listThen define a line type to be a word list. Then, we can specify that convert_to_non_blank_lines_of_words has the type char list -> line list. In writing convert_to_non_blank_lines_of_words you may want to consider a helper function that breaks up a char list into lines, separated by new line characters ( '\n') and another that breaks up lines into lists of words. At this point you are not required to directly address the problems relating to capitalization of letters which we eventually need to address in checking that the same words appear in various parts of the poem. You are also not required to deal with issues of punctuation, but you may need to do something the be sure that words are correctly separated. For example, we would want to see that, barn as two words.

ansver
Answers: 3

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 23:30
Which of the following is not a symptom of chronic fatigue syndrome
Answers: 2
question
Computers and Technology, 23.06.2019 15:30
The processing of data in a computer involves the interplay between its various hardware components.
Answers: 1
question
Computers and Technology, 24.06.2019 02:00
Which steps will open the system so that you can enter a question and do a search for
Answers: 1
question
Computers and Technology, 24.06.2019 07:30
John recently worked on a project about various programming languages. he learned that though procedural language programs are useful, they have disadvantages too. what is a disadvantage of programs written in procedural languages? a. programs do not represent data complexity. b. programs take more time to execute. c. programs are prone to security threats. d. programs do not interface with multiple platforms.
Answers: 3
You know the right answer?
Preparing text for the paradelle check. The poems that we aim to check are stored as values of type...
Questions
question
Mathematics, 24.12.2019 00:31
question
Computers and Technology, 24.12.2019 00:31
question
Computers and Technology, 24.12.2019 00:31
Questions on the website: 13722361