This is my partial code: [code=java] public class Document { Word[] words; // An
ID: 3658323 • Letter: T
Question
This is my partial code: [code=java] public class Document { Word[] words; // An array of Word objects representing the words in document. String[] ignoreList; // An array of String objects representing the strings. DocumentReader lineReader; // A DocumentReader from which to read the lines of the document. int uniqueWord; // An integer which counts the number of unique words seen. int line; // An integer that stores the numbers of lines in the document. public Document(String url) { words = new Word[10]; } [/code] How do I initialize "lineReader" to the constructor above?Explanation / Answer
I am just providing the constructor. (Also I am assuming that you are using the Stanford Java NLP api for DocumentReader). public Document(String url) { words = new Word[10]; Reader r = DocumentReader.getReader(url); lineReader = new DocumentReader(r); // Initialise the other variables as you wish } There are other versions of DocumentReader too on the net which you may use.
Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.