2018-04-25 19:30:49 +02:00
|
|
|
/* SPDX-License-Identifier: GPL-2.0 */
|
|
|
|
|
2018-04-25 16:13:34 +02:00
|
|
|
#ifndef __TRANSLITERATION_H
|
|
|
|
#define __TRANSLITERATION_H
|
|
|
|
|
2020-01-01 16:33:27 +01:00
|
|
|
enum translit_letter_type {
|
|
|
|
VOWEL,
|
|
|
|
CONSONANT,
|
|
|
|
CODA,
|
|
|
|
SPECIAL,
|
|
|
|
NUMBER,
|
|
|
|
VOWEL_SIGN
|
|
|
|
};
|
2018-04-25 18:54:47 +02:00
|
|
|
|
2020-01-01 16:33:27 +01:00
|
|
|
struct translit_letter {
|
2018-04-29 08:21:46 +02:00
|
|
|
unsigned int code;
|
2020-01-01 16:33:27 +01:00
|
|
|
enum translit_letter_type type;
|
2018-04-27 18:58:07 +02:00
|
|
|
const char *data;
|
2018-04-25 18:54:47 +02:00
|
|
|
};
|
|
|
|
|
2020-01-01 16:33:27 +01:00
|
|
|
struct translit_context {
|
2020-01-01 16:56:43 +01:00
|
|
|
struct translit_letter *table;
|
2018-04-25 18:11:56 +02:00
|
|
|
};
|
|
|
|
|
2020-01-01 16:56:43 +01:00
|
|
|
char *transliterate_devanagari_to_latin(const char *text);
|
2018-04-27 11:59:32 +02:00
|
|
|
|
2018-04-30 18:46:15 +02:00
|
|
|
static inline int is_devanagari(unsigned int code)
|
|
|
|
{
|
|
|
|
return code >= 0x0900 && code <= 0x097f;
|
|
|
|
}
|
|
|
|
|
2018-04-25 16:13:34 +02:00
|
|
|
#endif /* __TRANSLITERATION_H */
|