Skip to content

Commit

Permalink
Merge pull request #192 from wilzbach/patch-45
Browse files Browse the repository at this point in the history
use wordcount example with lowerCase words
  • Loading branch information
stonemaster committed May 25, 2016
2 parents e3a7f93 + d850069 commit 251a37f
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion public/content/en/basics.md
Original file line number Diff line number Diff line change
Expand Up @@ -1031,6 +1031,7 @@ int[string] wordCount(string text)
// The function splitter lazily splits the
// input into a range
import std.algorithm.iteration: splitter;
import std.string: toLower;

// Indexed by words and returning the count
int[string] words;
Expand All @@ -1043,7 +1044,7 @@ int[string] wordCount(string text)
// The parameter we pass behind ! is an
// expression that marks the condition when
// to split text
foreach(word; splitter!pred(text)) {
foreach(word; splitter!pred(text.toLower())) {
// Increment word count if word
// has been found.
// Integers are by default 0.
Expand Down

0 comments on commit 251a37f

Please sign in to comment.