# Hyphenation Lists

> Find, install and choose hyph_*.dic hyphenation lists in WPF: the HyphenationLists folder, languages per archive, HyphenationLanguage in XAML, list settings.

- **Product:** TX Spell .NET for WPF
- **Section:** Documentation
- **Kind:** Topic
- **Path:** TX Spell .NET for WPF > Hyphenation > Hyphenation Lists
- **2639 words**
- **Web URL:** https://docs.textcontrol.com/tx-spell-dotnet-wpf/hyphenation/lists/
- **LLMs URL:** https://docs.textcontrol.com/tx-spell-dotnet-wpf/hyphenation/lists/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/tx-spell-dotnet-wpf/hyphenation/lists/llms-full.txt

---

A hyphenation list holds the rules by which the words of one language are divided at the end of a line. TX Spell .NET reads these rules from the hyphenation dictionaries of the open source Hunspell project, the same kind of files that OpenOffice uses. Find out where the files come from, how TX Spell .NET chooses one for a text, and how to load and adjust a list in code.

### What a Hyphenation List Is

A hyphenation list is a text file of patterns for one language. Its name starts with *hyph\_* and ends with *.dic*, such as *hyph\_en\_US.dic* for English (United States) or *hyph\_de\_DE.dic* for German (Germany). The first line names the encoding of the file, such as `UTF-8`; the patterns follow.

In code, a list is a [HyphenationList](https://docs.textcontrol.com/tx-spell-dotnet-wpf/reference/txtextcontrol-proofing/hyphenationlist/llms-full.txt). The spell checker uses a list only after it has been added to its [HyphenationLists](https://docs.textcontrol.com/tx-spell-dotnet-wpf/reference/txtextcontrol-wpf-proofing/txspellchecker/hyphenationlists-property/llms-full.txt) collection, and it takes the language of the list from the file name: *hyph\_en.dic* is English, *hyph\_de\_CH.dic* German (Switzerland).

Hyphenation lists are separate from the dictionaries that check spelling. A dictionary and a hyphenation list of the same language are two files in two folders, and a language can have one without the other.

### Where the Files Are

TX Spell .NET looks for hyphenation lists in the *HyphenationLists* folder:

| Where the application runs | Folder |
|---|---|
| On the development machine, after the setup | *\\Assembly\\HyphenationLists* in the installation directory of TX Spell .NET |
| Built with the NuGet package, or deployed | *HyphenationLists* in the folder of the application |
| Anywhere else | The folder set in [HyphenationListsDirectoryPath](https://docs.textcontrol.com/tx-spell-dotnet-wpf/reference/txtextcontrol-wpf-proofing/txspellchecker/hyphenationlistsdirectorypath-property/llms-full.txt) |

The package `TXTextControl.TXSpell.WPF.SDK` brings one list, *hyph\_en\_US.dic*, and copies it into *HyphenationLists* in the output directory when you build. [AvailableHyphenationLists](https://docs.textcontrol.com/tx-spell-dotnet-wpf/reference/txtextcontrol-wpf-proofing/txspellchecker/availablehyphenationlists-property/llms-full.txt) returns the names of all lists in the folder.

### Get Lists for Other Languages

Text Control offers the language data of TX Spell .NET as ZIP archives, one per language, each with the folder *Dictionaries* and, for many languages, *HyphenationLists* and *SynonymLists*. Copy the *hyph\_* file from the *HyphenationLists* folder of an archive into the *HyphenationLists* folder of your application. Of the 47 archives, 32 contain a hyphenation list:

| Language | Archive | Hyphenation list |
|---|---|---|
| Afrikaans | af\_ZA | *hyph\_af\_ZA.dic* |
| Bulgarian | bg\_BG | *hyph\_bg\_BG.dic* |
| Catalan | ca\_ES | *hyph\_ca.dic* |
| Croatian | hr\_HR | *hyph\_hr\_HR.dic* |
| Czech | cs\_CZ | *hyph\_cs\_CZ.dic* |
| Danish | da\_DK | *hyph\_da\_DK.dic* |
| Dutch | nl\_NL | *hyph\_nl\_NL.dic* |
| English | en\_AU, en\_CA, en\_GB, en\_US | *hyph\_en\_AU.dic*, *hyph\_en\_CA.dic*, *hyph\_en\_GB.dic*, *hyph\_en\_US.dic* |
| Estonian | et\_EE | *hyph\_et\_EE.dic* |
| French | fr, fr\_FR | *hyph\_fr.dic* |
| German | de\_AT, de\_CH, de\_DE | *hyph\_de\_AT.dic*, *hyph\_de\_CH.dic*, *hyph\_de\_DE.dic* |
| Greek | el\_GR | *hyph\_el\_GR.dic* |
| Irish | ga\_IE | *hyph\_ga\_IE.dic* |
| Italian | it\_IT | *hyph\_it\_IT.dic* |
| Norwegian | nb\_NO, nn\_NO | *hyph\_nb\_NO.dic*, *hyph\_nn\_NO.dic* |
| Polish | pl\_PL | *hyph\_pl\_PL.dic* |
| Portuguese | pt\_BR, pt\_PT | *hyph\_pt\_BR.dic*, *hyph\_pt\_PT.dic* |
| Romanian | ro\_RO | *hyph\_ro\_RO.dic* |
| Russian | ru\_RU | *hyph\_ru\_RU.dic* |
| Serbian | sr | *hyph\_sr.dic*, *hyph\_sh.dic* |
| Slovak | sk\_SK | *hyph\_sk\_SK.dic* |
| Slovenian | sl\_SI | *hyph\_sl\_SI.dic* |
| Spanish | es\_ES | *hyph\_es\_ANY.dic* |
| Swedish | sv\_SE | *hyph\_sv.dic* |

The archives of Arabic, Belarusian, Hebrew, Persian, Urdu, Vietnamese and some other languages have a dictionary but no hyphenation list. [Dictionaries and Languages](https://docs.textcontrol.com/tx-spell-dotnet-wpf/dictionaries/llms-full.txt) describes the archives, and the blog article [TX Spell .NET 4.0: New Dictionaries and Hyphenation Lists Available](https://www.textcontrol.com/blog/2013/11/21/tx-spell-net-40-new-dictionaries-and-hyphenation-lists-available/) announced them.

### How a List Is Chosen

The [HyphenationLanguage](https://docs.textcontrol.com/tx-spell-dotnet-wpf/reference/txtextcontrol-wpf-proofing/txspellchecker/hyphenationlanguage-property/llms-full.txt) property of the `TXSpellChecker` selects the default list, the one used for text without a language of its own. It is `"(Auto)"` unless you set it, in code or on the resource that declares the spell checker in XAML:

```xml
<spell:TXSpellChecker x:Key="txSpellChecker1" HyphenationLanguage="(Auto)" />
```

| Value | Default list |
|---|---|
| `"(Auto)"` | The list in the language of the default spell check dictionary, set by [Language](https://docs.textcontrol.com/tx-spell-dotnet-wpf/reference/txtextcontrol-wpf-proofing/txspellchecker/language-property/llms-full.txt). Without an exact match, a list of nearly the same language, such as *hyph\_en\_US.dic* for British English. When `Language` is `"(none)"`, the list in the language of the application's environment |
| The file name of a list, such as `"hyph_de_DE.dic"` | That list, from the *HyphenationLists* folder |
| `"(none)"` | No list is set |

The chosen list is added to `HyphenationLists`, and its [IsSelectedAsDefault](https://docs.textcontrol.com/tx-spell-dotnet-wpf/reference/txtextcontrol-proofing/hyphenationlist/isselectedasdefault-property/llms-full.txt) property is `true`. When the folder has no list for the language, the property is reset to `"(none)"`. With a `TextControl`, text that has a language of its own is hyphenated with a list of that language, as [Hyphenation with TX Text Control](https://docs.textcontrol.com/tx-spell-dotnet-wpf/hyphenation/tx-text-control/llms-full.txt) describes.

### Change How Words Are Divided

Each list has settings that apply to the words of its language:

| Property | Default | Effect |
|---|---|---|
| [HyphenateCapitalizedWords](https://docs.textcontrol.com/tx-spell-dotnet-wpf/reference/txtextcontrol-proofing/hyphenationlist/hyphenatecapitalizedwords-property/llms-full.txt) | `true` | Words in uppercase, such as "HYPHENATION", are hyphenated |
| [MinCharsAtWordBegin](https://docs.textcontrol.com/tx-spell-dotnet-wpf/reference/txtextcontrol-proofing/hyphenationlist/mincharsatwordbegin-property/llms-full.txt) | 2 | The fewest characters at the begin of a word, before a division |
| [MinCharsAtWordEnd](https://docs.textcontrol.com/tx-spell-dotnet-wpf/reference/txtextcontrol-proofing/hyphenationlist/mincharsatwordend-property/llms-full.txt) | 2 | The fewest characters at the end of a word, after a division |
| [UseOnlyCompoundHyphenationPoints](https://docs.textcontrol.com/tx-spell-dotnet-wpf/reference/txtextcontrol-proofing/hyphenationlist/useonlycompoundhyphenationpoints-property/llms-full.txt) | `false` | Compound words are divided only between their parts, as "Rechtschreib-prüfung" in German |
| [MinSyllablesBeforeCompoundHyphenationPoint](https://docs.textcontrol.com/tx-spell-dotnet-wpf/reference/txtextcontrol-proofing/hyphenationlist/minsyllablesbeforecompoundhyphenationpoint-property/llms-full.txt) | 1 | The fewest syllables before a division between compound parts |
| [MinSyllablesAfterCompoundHyphenationPoint](https://docs.textcontrol.com/tx-spell-dotnet-wpf/reference/txtextcontrol-proofing/hyphenationlist/minsyllablesaftercompoundhyphenationpoint-property/llms-full.txt) | 1 | The fewest syllables after a division between compound parts |

With 3 characters at the begin and the end, for example, "international" is divided as inter-na-tional instead of in-ter-na-tion-al. The user changes the same settings on the **Hyphenation** tab of the options dialog, here in version 4.0:

![The Hyphenation tab of the Options dialog with the language English (United States), the check box Hyphenate words in UPPERCASE, the minimum numbers of characters at word end and begin set to 2, and the Compound words settings.](https://docs.textcontrol.com/assets/img/tx-spell-dotnet-wpf/options-hyphenation-tab.264e2266.webp)

[Options Dialog](https://docs.textcontrol.com/tx-spell-dotnet-wpf/user-interface/options-dialog/#the-hyphenation-and-thesaurus-tabs) lists the settings of the current dialog and the property behind each.

### Load a List in Code

To hyphenate another language than the default one, add its list to `HyphenationLists`. The file must be in the *HyphenationLists* folder, or you pass its full path.

`txSpellChecker1` is the spell checker taken from the resources of the window with `FindResource`, as [As-You-Type Checking](https://docs.textcontrol.com/tx-spell-dotnet-wpf/spell-checking/as-you-type/llms-full.txt) shows:

```csharp
using TXTextControl.Proofing;

// Load the German hyphenation list from the HyphenationLists folder
HyphenationList german = new HyphenationList("hyph_de_DE.dic");
txSpellChecker1.HyphenationLists.Add(german);

// Keep at least three characters on each line
german.MinCharsAtWordBegin = 3;
german.MinCharsAtWordEnd = 3;
```

The code works as follows:

- The [HyphenationList](https://docs.textcontrol.com/tx-spell-dotnet-wpf/reference/txtextcontrol-proofing/hyphenationlist/constructor/llms-full.txt) constructor takes the file name or the full path. A file name without a path is looked for in the default *HyphenationLists* folder.
- [Add](https://docs.textcontrol.com/tx-spell-dotnet-wpf/reference/txtextcontrol-proofing/hyphenationlistcollection/add-method/llms-full.txt) checks the file. It throws an `ArgumentException` when the file doesn't exist ("File does not exist") or its name doesn't have the form *hyph\_\*.dic* ("Dictionary type is not valid.").
- After `Add`, [Language](https://docs.textcontrol.com/tx-spell-dotnet-wpf/reference/txtextcontrol-proofing/hyphenationlist/language-property/llms-full.txt) holds the language read from the file name and [Name](https://docs.textcontrol.com/tx-spell-dotnet-wpf/reference/txtextcontrol-proofing/hyphenationlist/name-property/llms-full.txt) the name you passed.

To change the settings of a list that is already loaded, such as the English list, get it by its name with [GetItem](https://docs.textcontrol.com/tx-spell-dotnet-wpf/reference/txtextcontrol-proofing/hyphenationlistcollection/getitem-method/llms-full.txt):

```csharp
HyphenationList english = txSpellChecker1.HyphenationLists.GetItem("hyph_en_US.dic");

if (english != null)
{
    // Don't hyphenate words in uppercase, such as product names
    english.HyphenateCapitalizedWords = false;
}
```

`GetItem` returns `null` when no list of that name is loaded. The indexer, `HyphenationLists[0]`, reaches a list by its position instead.

### Next Steps

- [Hyphenation with TX Text Control](https://docs.textcontrol.com/tx-spell-dotnet-wpf/hyphenation/tx-text-control/llms-full.txt): hyphenate the text of an editor as the user types.
- [Hyphenating Text in Code](https://docs.textcontrol.com/tx-spell-dotnet-wpf/hyphenation/in-code/llms-full.txt): find the hyphenation points of a word.
- [Options Dialog](https://docs.textcontrol.com/tx-spell-dotnet-wpf/user-interface/options-dialog/llms-full.txt): the settings users change themselves.
- [Dictionaries Not Found](https://docs.textcontrol.com/tx-spell-dotnet-wpf/troubleshooting/dictionaries/#words-aren-t-hyphenated-or-no-synonyms-are-found): what to check when words aren't hyphenated.

---

## Nearby

- **Previous:** [Hyphenation](https://docs.textcontrol.com/tx-spell-dotnet-wpf/hyphenation/llms-full.txt)
- **Next:** [Hyphenation With TX Text Control](https://docs.textcontrol.com/tx-spell-dotnet-wpf/hyphenation/tx-text-control/llms-full.txt)
