> ## Documentation Index
> Fetch the complete documentation index at: https://www.algolia.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Customize word segmentation

> Learn how to customize word segmentation dictionaries through the Algolia dashboard.

export const SearchQuery = () => <Tooltip tip="The text users enter into a search box. In the Search API, this corresponds to the query parameter. A search query is often used with filters, facets, and other parameters, but these aren't part of the query text itself.">
    search query
  </Tooltip>;

export const Records = () => <Tooltip tip="A record is a searchable object in an Algolia index. Each record consists of named attributes." cta="Algolia records" href="/doc/guides/sending-and-managing-data/prepare-your-data#algolia-records">
    records
  </Tooltip>;

export const Application = () => <Tooltip tip="An Algolia application is a self-contained environment with its own indices, configuration, and API keys. Applications don't share data or settings with each other.">
    application
  </Tooltip>;

export const AlgoliaSearch = () => <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 80 80" width="20" height="20" className="inline" fill="none" role="presentation" ariaLabel="Algolia Search">
    <circle cx="40" cy="32" r="28" fill="#5468FF"></circle>
    <rect x="30" y="22" width="20" height="20" rx="10" fill="#fff"></rect>
    <path d="M43 63.5 54.5 60l6 17h-12L43 63.5Z" fill="#36395A"></path>
  </svg>;

Word segmentation, or decompounding, splits a compound word into its parts.
For example, Algolia splits the Dutch word "eettafel" (dining table) into "eet" and "tafel".
The engine can then match the parts of a word, not only the whole word.

The [`decompoundedAttributes`](/doc/api-reference/api-parameters/decompoundedAttributes) setting specifies which attributes to decompound in your <Records />, and in which languages.
On the <SearchQuery />, decompounding applies when the index's [query language](/doc/guides/managing-results/optimize-search-results/handling-natural-languages-nlp/how-to/how-to-set-an-index-query-language) supports it.

Algolia provides a built-in segmentation dictionary for German, Dutch, Finnish, Swedish, Danish, and Norwegian.
You can customize each one in the [Algolia dashboard](https://dashboard.algolia.com/dictionaries/segmentation?lang=de).

**Each Algolia <Application /> uses one segmentation dictionary per language.**
Your changes affect every index that has this query language and sets [`decompoundedAttributes`](/doc/api-reference/api-parameters/decompoundedAttributes).

## Open a segmentation dictionary

The **Words Segmentation** tab is available only for languages that have a segmentation dictionary.
For any other language, the tab stays turned off.

1. Go to the [Algolia dashboard](https://dashboard.algolia.com/explorer/browse) and select your Algolia <Application />.
2. In the left sidebar, select <AlgoliaSearch /> **Search**.
3. Go to the [**Dictionaries**](https://dashboard.algolia.com/dictionaries/segmentation?lang=de) page.
4. Select the language you want to customize.
5. Select the **Words Segmentation** tab.

## Inspect segmentation

1. [Open a segmentation dictionary](#open-a-segmentation-dictionary).
2. Search for a word.
3. Under **Algolia segmentation**, see how the engine reads the word.

The search box takes one word and strips any spaces.
If the engine splits the word, the parts appear as tags.
Otherwise, the engine keeps the word as is.

## Create custom segmentation entries

Algolia may not split a compound word that contains a brand name or a proper noun, such as the Dutch "gyprocplaten" (drywall).
Searches then match the whole word only, not "gyproc" or "platen".

To split a word yourself:

1. [Open a segmentation dictionary](#open-a-segmentation-dictionary).
2. Search for the word.
3. Under **Algolia segmentation**, select <Icon icon="pencil" /> **Edit**.
4. Select **Split**, then enter the parts.
5. Select **Save**, then select **Review and Save**.

A split needs at least two parts, and each part must be a subset of the original word.

## Turn off segmentation for words

Algolia may split a word that your catalog needs whole, such as the German brand "Volkswagen" into "volks" and "wagen".

To keep a word whole:

1. [Open a segmentation dictionary](#open-a-segmentation-dictionary).
2. Search for the word.
3. Under **Algolia segmentation**, select <Icon icon="pencil" /> **Edit**.
4. Select **Keep as is**.
5. Select **Save**, then select **Review and Save**.

## Delete custom segmentation entries

You can only delete your own segmentation entries.
Algolia's segmentation always remains, and your custom entry overrides it.

To delete an entry:

1. [Open a segmentation dictionary](#open-a-segmentation-dictionary).
2. Search for the word.
3. Select <Icon icon="trash" /> **Delete**.
4. Select **Review and Save**.

## Upload and download customizations

[Open a segmentation dictionary](#open-a-segmentation-dictionary), then select <Icon icon="settings" /> **Actions**:

* To upload your own list, select **Upload your segmentations list**.
* To export what you added, select **Download your segmentations list as JSON** or **as CSV**.

### Upload format

<CodeGroup>
  ```csv CSV theme={"system"}
  word,decomposition,language,objectID
  gyprocplaten,"gyproc,platen",nl,1
  volkswagen,"volkswagen",de,2
  ```

  ```json JSON theme={"system"}
  [
    {
      "word": "gyprocplaten",
      "decomposition": ["gyproc", "platen"],
      "language": "nl",
      "objectID": "1"
    },
    {
      "word": "volkswagen",
      "decomposition": ["volkswagen"],
      "language": "de",
      "objectID": "2"
    }
  ]
  ```
</CodeGroup>

Don't put a space after a comma.
The dashboard matches the header row character for character, so ` language` doesn't match `language`, and the upload skips the rows it can't match.
In CSV, put the parts in one quoted, comma-separated list.
To keep a word whole, give it one part equal to the word.

## Manage segmentation programmatically

The dashboard isn't the only way to customize a dictionary.
Segmentation entries live in the `compounds` dictionary.

* Algolia CLI: the [`algolia dictionary entries`](/doc/tools/cli/commands/dictionary/entries) commands
* API clients: [save](/doc/libraries/sdk/v1/methods/save-dictionary-entries), [search](/doc/libraries/sdk/v1/methods/search-dictionary-entries), [delete](/doc/libraries/sdk/v1/methods/delete-dictionary-entries), and [clear](/doc/libraries/sdk/v1/methods/clear-dictionary-entries) dictionary entries
* Search API: [add or delete dictionary entries](/doc/rest-api/search/batch-dictionary-entries), [search dictionary entries](/doc/rest-api/search/search-dictionary-entries)
