libthai: thai/thinp.h File Reference

libthai 0.1.26

Data Structures | Enumerations | Functions
thinp.h File Reference

Thai string input sequence filtering. More...

## Data Structures
struct | thinpconv_t
| Input sequence correction info. More...

## Enumerations
enum | thstrict_t { ISC_PASSTHROUGH = 0, ISC_BASICCHECK = 1, ISC_STRICT = 2 }
| Strictness of input sequence checking, according to WTT 2.0. More...

## Functions
int | th_isaccept (thchar_t c1, thchar_t c2, thstrict_t s)
| Check for acceptance of input sequence. More...
int | th_validate (struct thcell_t context, thchar_t c, struct thinpconv_t *conv)
| Check and try to correct input sequence with default strictness. More...
int | th_validate_leveled (struct thcell_t context, thchar_t c, struct thinpconv_t *conv, thstrict_t s)
| Check and try to correct input sequence. More...

## Detailed Description

Thai string input sequence filtering.

## Enumeration Type Documentation

## ◆ thstrict_t

enum thstrict_t

Strictness of input sequence checking, according to WTT 2.0.

Enumerator
ISC_PASSTHROUGH | No check
ISC_BASICCHECK | Basic check
ISC_STRICT | Strict check

## Function Documentation

## ◆ th_isaccept()

int th_isaccept | ( | thchar_t | c1,
|  | thchar_t | c2,
|  | thstrict_t | s
| ) |  |

Check for acceptance of input sequence.

Parameters

  c1 | : previous character
  c2 | : the newly input character
  s | : strictness level

Returns
  non-zero if accepted, 0 otherwise

Checks if, according to WTT 2.0 strictness level s, c2 is allowed after c1.

## ◆ th_validate()

int th_validate | ( | struct thcell_t | context,
|  | thchar_t | c,
|  | struct thinpconv_t * | conv
| ) |  |

Check and try to correct input sequence with default strictness.

Parameters

  context | : previous cell
  c | : the newly input character
  conv | : the storage for resulting correction info

Returns
  0 if the input is to be rejected non-zero otherwise.

Given the previous cell as context, edit the input buffer using the given input c, maintaining WTT canonical order at default strictness level, and do some convenient correction in conv.

## ◆ th_validate_leveled()

int th_validate_leveled | ( | struct thcell_t | context,
|  | thchar_t | c,
|  | struct thinpconv_t * | conv,
|  | thstrict_t | s
| ) |  |

Check and try to correct input sequence.

Parameters

  context | : previous cell
  c | : the newly input character
  conv | : the storage for resulting correction info
  s | : strictness level

Returns
  0 if the input is to be rejected non-zero otherwise.

Given the previous cell as context, edit the input buffer using the given input c, maintaining WTT canonical order at strictness level s, and do some convenient correction in conv.

(Available since version 0.1.19, libthai.so.0.2.0)