Menu
Open source RSS

Grafana Labs’ dictionary

The Grafana Labs documentation team maintains a dictionary used for spell checking. The same dictionary is used to generate some Vale rules from the metadata in the word definition.

The dictionary uses the Hunspell format generated from a Jsonnet template.

If a word doesn’t yet exist in the dictionary, you can add one by modifying the appropriate dictionary template file.

To add a new word to the dictionary, refer to Add words to the Grafana Labs dictionary.

Word metadata

Each word in the dictionary has metadata that describes it. The structure of that metadata is a Jsonnet object with the following fields:

KeyValue typeDescription
wordstringThe spelling of the word.
affixesstringA concatenation of the letters corresponding to Hunspell affixes. For more information, refer to Hunspell affixes
postringThe part of speech descriptor for the word. Known acceptable values include 'noun', 'adjective', and 'verb'.
descriptionstringA description of the word.
abbreviationbooleanIf true, the word is an abbreviation. Defaults to false.
established_abbreviationbooleanIf true, the abbreviation doesn’t generally need explaining, like the abbreviation HTTP. Defaults to false
productbooleanIf true, the word is the name of any product, like Mimir or Facebook. Defaults to false.
AmazonbooleanIf true, the word is the name of an Amazon product, like Amazon CloudWatch. Defaults to false.
ApachebooleanIf true, the word is the name of an Apache project, like Apache Mesos. Defaults to false.

You don’t create the object directly in the dictionary template file. Instead, you use the word.new function which prescribes the required fields.

To add new word, refer to Add words to the Grafana Labs dictionary.

To understand the Hunspell affixes, refer to Hunspell affixes.

Hunspell affixes

Hunspell affixes teach the dictionary multiple words by applying affix rules to the stem word. The affix rules are defined in en_US-grafana.aff.

Note

Affixes are case sensitive. d is a different affix to D
LetterKindDescription
dPrefixAdds the de prefix to the stem, making deprovision from provision.
mPrefixAdds the mis prefix to the stem, making misconfigure from configure.
pPrefixAdds the pre prefix to the stem, making preconfigure from configure.
uPrefixAdds the un prefix to the stem, making unregister from register.
DSuffixAdds the past tense suffix ed to the stem, making ingested from ingest.
GSuffixAdds the gerund suffix ing to the stem, making singing from sing.
MSuffixAdds the possessive suffix 's to the stem, making ingester’s from ingester.
RSuffixAdds the r suffix to the stem, making profiler from profile.
SSuffixAdds the plural suffix s to the stem, making namespaces from namespace.