src/textgen/MarkovTextGeneratorLoL.java
@Override
	public void retrain(String sourceText)
	{
		// TODO: Implement this method.
		this.wordList = new LinkedList<ListNode>();
        if (sourceText.length() != 0) {
            ListNode temp;
            String[] words = sourceText.split("[\\s]+");
            this.starter = words[0];
            ListNode last = temp = new ListNode(this.starter);
            this.wordList.add(last);
            for (int i = 1; i < words.length; ++i) {
                temp = this.find(last.getWord());
                temp.addNextWord(words[i]);
                ListNode temp2 = this.find(words[i]);
                if (!temp2.getWord().equals("not found")) {
                    last = temp2;
                    continue;
                }
                temp2 = new ListNode(words[i]);
                this.wordList.add(temp2);
                last = temp2;
            }
        }
	}
/** Retrain the generator from scratch on the source text */
Retrain the generator from scratch on the source text
Retrain the generator from scratch on the source text
@Override
	public void retrain(String sourceText)
	{
		this.wordList = new LinkedList<ListNode>();
        if (sourceText.length() != 0) {
            ListNode temp;
            String[] words = sourceText.split("[\\s]+");
            this.starter = words[0];
            ListNode last = temp = new ListNode(this.starter);
            this.wordList.add(last);
            for (int i = 1; i < words.length; ++i) {
                temp = this.find(last.getWord());
                temp.addNextWord(words[i]);
                ListNode temp2 = this.find(words[i]);
                if (!temp2.getWord().equals("not found")) {
                    last = temp2;
                    continue;
                }
                temp2 = new ListNode(words[i]);
                this.wordList.add(temp2);
                last = temp2;
            }
        }
	}
@ Override public void retrain ( String sourceText ) { this . wordList = new LinkedList < ListNode > ( ) ; if ( sourceText . length ( ) != 0 ) { ListNode temp ; String [ ] words = sourceText . split ( "[\\s]+" ) ; this . starter = words [ 0 ] ; ListNode last = temp = new ListNode ( this . starter ) ; this . wordList . add ( last ) ; for ( int i = 1 ; i < words . length ; ++ i ) { temp = this . find ( last . getWord ( ) ) ; temp . addNextWord ( words [ i ] ) ; ListNode temp2 = this . find ( words [ i ] ) ; if ( ! temp2 . getWord ( ) . equals ( "not found" ) ) { last = temp2 ; continue ; } temp2 = new ListNode ( words [ i ] ) ; this . wordList . add ( temp2 ) ; last = temp2 ; } } }
Retrain the generator from scratch on the source text
Retrain the generator from scratch on the source text
// TODO: Implement this method.
