Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

This is my partial code: public class Document { Word[] words; // An array of Wo

ID: 3658321 • Letter: T

Question

This is my partial code: 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]; } In the above constructor, I also want to initialize the Document Reader instance variable(lineReader) to read the url. how do i do this?

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.

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote