---
name: "WordType"
section: "3"
platform: "linux"
package: "libmifluz0-dev"
version: "0.24.0-9"
release: "Debian 3.1 (Sarge)"
platforms: ["linux"]
url: "https://new.carta.tech/WordType"
---

# WordType(3)

defines a word in term of allowed characters, length etc.

## NAME

WordType - defines a word in term of allowed characters, length etc.

## SYNOPSIS

```
Only called thru WordContext::Initialize()
```

## DESCRIPTION

WordType defines an indexed word and operations to validate a word to be indexed. All words inserted into the *mifluz* index are **Normalize** d before insertion. The configuration options give some control over the definition of a word.

## CONFIGURATION

For more information on the configuration attributes and a complete list of attributes, see the [mifluz(3)](/mifluz/3.md) manual page.

- **wordlist\_locale \<locale\> (default C)**

  Set the locale of the program to **locale** for more information.

- **wordlist\_allow\_numbers {true\|false} \<number\> (default false)**

  A digit is considered a valid character within a word if this configuration parameter is set to *true* otherwise it is an error to insert a word containing digits. See the **Normalize** method for more information.

- **wordlist\_mimimun\_word\_length \<number\> (default 3)**

  The minimum length of a word. See the **Normalize** method for more information.

- **wordlist\_maximum\_word\_length \<number\> (default 25)**

  The maximum length of a word. See the **Normalize** method for more information.

- **wordlist\_allow\_numbers {true\|false} \<number\> (default false)**

  A digit is considered a valid character within a word if this configuration parameter is set to *true* otherwise it is an error to insert a word containing digits. See the **Normalize** method for more information.

- **wordlist\_truncate {true\|false} \<number\> (default true)**

  If a word is too long according to the *wordlist\_maximum\_word\_length* it is truncated if this configuration parameter is *true* otherwise it is considered an invalid word.

- **wordlist\_lowercase {true\|false} \<number\> (default true)**

  If a word contains upper case letters it is converted to lowercase if this configuration parameter is true, otherwise it is left untouched.

- **wordlist\_valid\_punctuation \[characters\] (default none)**

  A list of punctuation characters that may appear in a word.  These characters will be removed from the word before insertion in the index.

## METHODS

- **int Normalize(String &s) const**

  Normalize a word according to configuration specifications and  builtin transformations. **Every** word inserted in the inverted index goes thru this function. If a word is rejected (return value has WORD\_NORMALIZE\_NOTOK bit set) it will not  be inserted in the index. If a word is accepted (return value has  WORD\_NORMALIZE\_OK bit set) it will be inserted in the index. In addition to these two bits, informational values are stored that give information on the processing done on the word. The bit field values and their meanings are as follows:

- **WORD\_NORMALIZE\_TOOLONG**

  the word length exceeds the value of \
       the *wordlist\_maximum\_word\_length* configuration parameter.

- **WORD\_NORMALIZE\_TOOSHORT**

  the word length is smaller than the value of \
       the *wordlist\_minimum\_word\_length* configuration parameter.

- **WORD\_NORMALIZE\_CAPITAL**

  the word contained capital letters and has been converted \
       to lowercase. This bit is only set\
       if the *wordlist\_lowercase* configuration parameter\
       is true.

- **WORD\_NORMALIZE\_NUMBER**

  the word contains digits and the configuration \
       parameter *wordlist\_allow\_numbers* is set to false.

- **WORD\_NORMALIZE\_CONTROL**

  the word contains control characters.

- **WORD\_NORMALIZE\_BAD**

  the word is listed in the file pointed by \
       the *wordlist\_bad\_word\_list* configuration parameter.

- **WORD\_NORMALIZE\_NULL**

  the word is a zero length string.

- **WORD\_NORMALIZE\_PUNCTUATION**

  at least one character listed in \
       the *wordlist\_valid\_punctuation* attribute was removed\
       from the word.

- **WORD\_NORMALIZE\_NOALPHA**

  the word does not contain any alphanumerical character.

- **static String NormalizeStatus(int flags)**

  Returns a string explaining the return flags of the Normalize method.

## AUTHORS

Loic Dachary loic@gnu.org

The Ht://Dig group http://dev.htdig.org/

## SEE ALSO

[htdb\_dump(1)](/htdb_dump/1.md), [htdb\_stat(1)](/htdb_stat/1.md), [htdb\_load(1)](/htdb_load/1.md), [mifluzdump(1)](/mifluzdump/1.md), [mifluzload(1)](/mifluzload/1.md), [mifluzsearch(1)](/mifluzsearch/1.md), [mifluzdict(1)](/mifluzdict/1.md), [WordContext(3)](/WordContext/3.md), [WordList(3)](/WordList/3.md), [WordDict(3)](/WordDict/3.md), [WordListOne(3)](/WordListOne/3.md), [WordKey(3)](/WordKey/3.md), [WordKeyInfo(3)](/WordKeyInfo/3.md), [WordDBInfo(3)](/WordDBInfo/3.md), [WordRecordInfo(3)](/WordRecordInfo/3.md), [WordRecord(3)](/WordRecord/3.md), [WordReference(3)](/WordReference/3.md), [WordCursor(3)](/WordCursor/3.md), [WordCursorOne(3)](/WordCursorOne/3.md), [WordMonitor(3)](/WordMonitor/3.md), [Configuration(3)](/Configuration/3.md), [mifluz(3)](/mifluz/3.md)
