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

# Wordlist

A Wordlist represents a collection of language-specific words used to encode and devoce
[BIP-39](https://en.bitcoin.it/wiki/BIP_0039) encoded data by mapping words to 11-bit values and vice versa.

## Extended by

* [`WordlistOwl`](/sdk/content/classes/WordlistOwl)

## Constructors

### new Wordlist()

```ts theme={null}
new Wordlist(locale): Wordlist
```

Creates a new Wordlist instance.

Sub-classes MUST call this if they provide their own constructor, passing in the locale string of the language.

Generally there is no need to create instances of a Wordlist, since each language-specific Wordlist creates an
instance and there is no state kept internally, so they are safe to share.

#### Parameters

| Parameter | Type     |
| :-------- | :------- |
| `locale`  | `string` |

#### Returns

[`Wordlist`](/sdk/content/classes/Wordlist)

#### Source

[wordlists/wordlist.ts:20](https://github.com/dominant-strategies/quais.js/blob/c1c12d43f9d34c6baad2b0542bd6d0acd6fefcbf/src/wordlists/wordlist.ts#L20)

## Methods

### getWord()

```ts theme={null}
abstract getWord(index): string
```

Maps an 11-bit value into its coresponding word in the list.

Sub-classes MUST override this.

#### Parameters

| Parameter | Type     |
| :-------- | :------- |
| `index`   | `number` |

#### Returns

`string`

#### Source

[wordlists/wordlist.ts:54](https://github.com/dominant-strategies/quais.js/blob/c1c12d43f9d34c6baad2b0542bd6d0acd6fefcbf/src/wordlists/wordlist.ts#L54)

***

### getWordIndex()

```ts theme={null}
abstract getWordIndex(word): number
```

Maps a word to its corresponding 11-bit value.

Sub-classes MUST override this.

#### Parameters

| Parameter | Type     |
| :-------- | :------- |
| `word`    | `string` |

#### Returns

`number`

#### Source

[wordlists/wordlist.ts:61](https://github.com/dominant-strategies/quais.js/blob/c1c12d43f9d34c6baad2b0542bd6d0acd6fefcbf/src/wordlists/wordlist.ts#L61)

***

### join()

```ts theme={null}
join(words): string
```

Sub-classes may override this to provider a language-specific method for joining `words` into a phrase.

By default, `words` are joined by a single space.

#### Parameters

| Parameter | Type        | Description        |
| :-------- | :---------- | :----------------- |
| `words`   | `string`\[] | The words to join. |

#### Returns

`string`

The joined phrase.

#### Source

[wordlists/wordlist.ts:45](https://github.com/dominant-strategies/quais.js/blob/c1c12d43f9d34c6baad2b0542bd6d0acd6fefcbf/src/wordlists/wordlist.ts#L45)

***

### split()

```ts theme={null}
split(phrase): string[]
```

Sub-classes may override this to provide a language-specific method for spliting `phrase` into individual words.

By default, `phrase` is split using any sequences of white-space as defined by regular expressions (i.e.
`/\s+/`).

#### Parameters

| Parameter | Type     | Description          |
| :-------- | :------- | :------------------- |
| `phrase`  | `string` | The phrase to split. |

#### Returns

`string`\[]

The split words in the phrase.

#### Source

[wordlists/wordlist.ts:33](https://github.com/dominant-strategies/quais.js/blob/c1c12d43f9d34c6baad2b0542bd6d0acd6fefcbf/src/wordlists/wordlist.ts#L33)
