Skip to content
Permalink
Browse files

Added whitespace trimming on ends of string to Line Length event driv…

…er before counting number of words. The unit test was failing because in some cases, extra whitespace on the ends were being counted as words.
  • Loading branch information...
DavidBerdik committed May 30, 2019
1 parent 055b7ba commit c69af32f9bd67700c5ea66e81eea228b3c20b02d
Showing with 1 addition and 1 deletion.
  1. +1 −1 src/com/jgaap/eventDrivers/LineLengthEventDriver.java
@@ -35,7 +35,7 @@ public EventSet createEventSet(char[] text) {
// Create an EventSet that consists of length values for each line.
EventSet lineLengths = new EventSet();
for(Event line : linesEventSet)
lineLengths.addEvent(new Event(Integer.toString(line.toString().split("\\s+").length), this));
lineLengths.addEvent(new Event(Integer.toString(line.toString().trim().split("\\s+").length), this));

return lineLengths;
}

0 comments on commit c69af32

Please sign in to comment.
You can’t perform that action at this time.