Skip to content

word-count: example implementation doesn't handle words with apostrophes #1045

@jackattack24

Description

@jackattack24

I updated the tests for word-count in PR #1044. However, the following two tests from the canonical data both failed with the example implementation:

    {
      "description": "with apostrophes",
      "property": "countwords",
      "input": "First: don't laugh. Then: don't cry.",
      "expected": {
        "first": 1,
        "don't": 2,
        "laugh": 1,
        "then": 1,
        "cry": 1
      }
    },
    {
      "description": "with quotations",
      "property": "countwords",
      "input": "Joe can't tell between 'large' and large.",
      "expected": {
        "joe": 1,
        "can't": 1,
        "tell": 1,
        "between": 1,
        "large": 2,
        "and": 1
      }
    }

"don't" ended up getting split into "don" and "t" which were counted as seperate words, and the same happened with "can't".

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