Overview

A very simple, naive word counting function. Give it a string and it will give back a map with count of each unique word.

Usage

Input

There is only a single input into this simple word counting function, and that is a basic string, which is assumed to be a sentence, a paragraph, etc.

ParameterDescription
textA string which consists of some number of English words.

Output

Result maps each word to number of times it occurred in the input.

ParameterDescription
resultA histogram in the form of a dictionary, or a hash table with words mapped to count.

Examples

{
    "text": "Some number of words"
}

Writing good docs:

Communicate Value

A good introduction should make it clear why someone might use your API.

Show and Tell

Give examples of using your API and explain those examples.

Easy to Skim

Ensure your docs are structured such that familiar users can quickly jump to the content they want.

Current

Revisit your docs after making breaking changes or adding new features to keep them up-to-date.