Tokenizers can be passed to the ngrams.NewIndex function to change the data tokenization mechanism. More details can be found in the ngrams README.
// New word tokenizer which includes line breaks as distinct tokens.
tk := NewDefaultWordTokenizer(false)
// New word tokenizer without tokenized line breaks.
tk := NewDefaultWordTokenizer(true)
New tokenizers can be created by satisfying the tokenizers.Tokenizer
interface.