ailiaTokenizerGetCharStarts method

int ailiaTokenizerGetCharStarts(
  1. Pointer<AILIATokenizer> net,
  2. Pointer<Int> char_starts,
  3. int count
)

Gets the Char start positions.

Parameters:

  • net: A tokenizer instance pointer
  • char_starts: Character start position
  • count: Token count

Returns:

If this function is successful, it returns AILIA_STATUS_SUCCESS , or an error code otherwise.

If ailiaTokenizerEncode() is not run at all, the function returns AILIA_STATUS_INVALID_STATE . This is valid only for AILIA_TOKENIZER_TYPE_ROBERTA and AILIA_TOKENIZER_TYPE_BERT. The character start positions in UTF-32 units corresponding to each token are returned.

Implementation

int ailiaTokenizerGetCharStarts(
  ffi.Pointer<AILIATokenizer> net,
  ffi.Pointer<ffi.Int> char_starts,
  int count,
) {
  return _ailiaTokenizerGetCharStarts(
    net,
    char_starts,
    count,
  );
}