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 18:00
Suppose an astronomer discovers a large, spherical-shaped body orbiting the sun. the body is composed mostly of rock, and there are no other bodies sharing its orbit. what is the best way to categorize this body? a. planet b. moon c. comet d. asteroid
Answers: 1
question
Computers and Technology, 22.06.2019 19:20
1)consider the following code snippet: #ifndef book_h#define book_hconst double max_cost = 1000.0; class book{public: book(); book(double new_cost); void set_cost(double new_cost); double get_cost() const; private: double cost; }; double calculate_terms(book bk); #endifwhich of the following is correct? a)the header file is correct as given.b)the definition of max_cost should be removed since header files should not contain constants.c)the definition of book should be removed since header files should not contain class definitions.d)the body of the calculate_terms function should be added to the header file.
Answers: 1
question
Computers and Technology, 23.06.2019 00:30
If joey was single and his taxable income was $9,500, how much would he pay in taxes each year?
Answers: 1
question
Computers and Technology, 23.06.2019 01:20
Write a function balancechemical to balance chemical reactions by solving a linear set of equations. the inputs arguments are: reagents: symbols of reagents in string row array products: symbols of products in string row array elements: elements in the reaction in string row array elcmpreag: elemental composition of reactants in two dimensional numeric array elcmpprdcts: elemental composition of prducts in two dimensional numeric array hint: the first part of the problem is setting up the set of linear equations that should be solve. the second part of the problem is to find the integers from the solution. one way to do this is to mulitiply the rational basis for the nullspace by increasing larger integers until both the left-and right-side integers exist. for example, for the reaction that involves reacting with to produce and : reagents=["ch4", "o2"]; products =["co2", "h2o"]; elements =["c","h", "o"] elcmpreag=[1,4,0;
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, 14.08.2021 09:50
question
Mathematics, 14.08.2021 09:50
question
Mathematics, 14.08.2021 09:50
question
Mathematics, 14.08.2021 09:50
question
Mathematics, 14.08.2021 09:50
question
English, 14.08.2021 09:50
question
Mathematics, 14.08.2021 09:50
question
English, 14.08.2021 14:00
question
English, 14.08.2021 14:00
question
Mathematics, 14.08.2021 14:00
Questions on the website: 13722363