Skip to content

Unexpected behaviour of ngram(sd, 3) #202

@aquatiko

Description

@aquatiko

I was expecting a Dict of trigrams upon calling this as mentioned in the docs. But I'm getting unigrams, bigrams and trigrams.

julia> sd = sd = StringDocument("To be or not to be...")
julia> ngrams(sd, 3)
Dict{AbstractString,Int64} with 14 entries:
  "to be"     => 1
  "not"       => 1
  "or not to" => 1
  "be or"     => 1
  "not to be" => 1
  "or"        => 1
  "not to"    => 1
  "To"        => 1
  "be or not" => 1
  "be"        => 2
  "To be"     => 1
  "or not"    => 1
  "to"        => 1
  "To be or"  => 1

Fixing this can help solve #201 next.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions