5a2910119ec0b878a0d7ca91918b97e9d40a936dTimo Sirainen#ifndef FTS_COMMON_H
5a2910119ec0b878a0d7ca91918b97e9d40a936dTimo Sirainen#define FTS_COMMON_H
5a2910119ec0b878a0d7ca91918b97e9d40a936dTimo Sirainen
bcc55b1547f2b23fc98a1d0ef3c9b1f85912a902Teemu Huovila/* Some might consider 0x02BB an apostrophe also. */
5a2910119ec0b878a0d7ca91918b97e9d40a936dTimo Sirainen#define IS_NONASCII_APOSTROPHE(c) \
5a2910119ec0b878a0d7ca91918b97e9d40a936dTimo Sirainen ((c) == 0x2019 || (c) == 0xFF07)
5a2910119ec0b878a0d7ca91918b97e9d40a936dTimo Sirainen#define IS_APOSTROPHE(c) \
5a2910119ec0b878a0d7ca91918b97e9d40a936dTimo Sirainen ((c) == 0x0027 || IS_NONASCII_APOSTROPHE(c))
3a54211bd6c4dc3f8687c16020770551cf83a548Teemu Huovila#define IS_WB5A_APOSTROPHE(c) \
3a54211bd6c4dc3f8687c16020770551cf83a548Teemu Huovila ((c) == 0x0027 || (c) == 0x2019)
3a54211bd6c4dc3f8687c16020770551cf83a548Teemu Huovila/* The h letters are included because it is an exception in French.
3a54211bd6c4dc3f8687c16020770551cf83a548Teemu Huovila A, E, H, I, O, U, Y, a, e, h, i, o, u, y */
3a54211bd6c4dc3f8687c16020770551cf83a548Teemu Huovila#define IS_ASCII_VOWEL(c) \
3a54211bd6c4dc3f8687c16020770551cf83a548Teemu Huovila ((c) == 0x0041 || (c) == 0x0045 || (c) == 0x0048 || (c) == 0x0049 || \
3a54211bd6c4dc3f8687c16020770551cf83a548Teemu Huovila (c) == 0x004F || (c) == 0x0055 || (c) == 0x0059 || (c) == 0x0061 || \
3a54211bd6c4dc3f8687c16020770551cf83a548Teemu Huovila (c) == 0x0065 || (c) == 0x0068 || (c) == 0x0069 || (c) == 0x006F || \
3a54211bd6c4dc3f8687c16020770551cf83a548Teemu Huovila (c) == 0x0075 || (c) == 0x0079)
3a54211bd6c4dc3f8687c16020770551cf83a548Teemu Huovila#define IS_NONASCII_VOWEL(c) \
3a54211bd6c4dc3f8687c16020770551cf83a548Teemu Huovila /*latin capital letter a with grave, acute and circumflex*/ \
3a54211bd6c4dc3f8687c16020770551cf83a548Teemu Huovila ((c) == 0x00C0 || (c) == 0x00C1 || (c) == 0x00C2 || \
3a54211bd6c4dc3f8687c16020770551cf83a548Teemu Huovila /* latin capital letter e with grave, acute and circumflex */ \
3a54211bd6c4dc3f8687c16020770551cf83a548Teemu Huovila (c) == 0x00C8 || (c) == 0x00C9 || (c) == 0x00CA || \
3a54211bd6c4dc3f8687c16020770551cf83a548Teemu Huovila /* latin capital letter i with grave, acute and circumflex */ \
3a54211bd6c4dc3f8687c16020770551cf83a548Teemu Huovila (c) == 0x00CC || (c) == 0x00CD || (c) == 0x00CE || \
3a54211bd6c4dc3f8687c16020770551cf83a548Teemu Huovila /* latin capital letter o with grave, acute and circumflex */ \
3a54211bd6c4dc3f8687c16020770551cf83a548Teemu Huovila (c) == 0x00D2 || (c) == 0x00D3 || (c) == 0x00D4 || \
3a54211bd6c4dc3f8687c16020770551cf83a548Teemu Huovila /* latin capital letter u with grave, acute and circumflex */ \
3a54211bd6c4dc3f8687c16020770551cf83a548Teemu Huovila (c) == 0x00D9 || (c) == 0x00DA || (c) == 0x00DB || \
3a54211bd6c4dc3f8687c16020770551cf83a548Teemu Huovila /* latin capital letter y with acute */ \
3a54211bd6c4dc3f8687c16020770551cf83a548Teemu Huovila (c) == 0x00DD || \
3a54211bd6c4dc3f8687c16020770551cf83a548Teemu Huovila /* latin small letter a with grave, acute and circumflex */ \
3a54211bd6c4dc3f8687c16020770551cf83a548Teemu Huovila (c) == 0x00E0 || (c) == 0x00E1 || (c) == 0x00E2 || \
3a54211bd6c4dc3f8687c16020770551cf83a548Teemu Huovila /* latin small letter e with grave, acute and circumflex */ \
3a54211bd6c4dc3f8687c16020770551cf83a548Teemu Huovila (c) == 0x00E8 || (c) == 0x00E9 || (c) == 0x00EA || \
3a54211bd6c4dc3f8687c16020770551cf83a548Teemu Huovila /* latin small letter i with grave, acute and circumflex */ \
3a54211bd6c4dc3f8687c16020770551cf83a548Teemu Huovila (c) == 0x00EC || (c) == 0x00ED || (c) == 0x00EE || \
3a54211bd6c4dc3f8687c16020770551cf83a548Teemu Huovila /* latin small letter o with grave, acute and circumflex */ \
3a54211bd6c4dc3f8687c16020770551cf83a548Teemu Huovila (c) == 0x00F2 || (c) == 0x00F3 || (c) == 0x00F4 || \
3a54211bd6c4dc3f8687c16020770551cf83a548Teemu Huovila /* latin small letter u with grave, acute and circumflex */ \
3a54211bd6c4dc3f8687c16020770551cf83a548Teemu Huovila (c) == 0x00F9 || (c) == 0x00FA || (c) == 0x00FB || \
3a54211bd6c4dc3f8687c16020770551cf83a548Teemu Huovila /* latin small letter y with acute */ \
3a54211bd6c4dc3f8687c16020770551cf83a548Teemu Huovila (c) == 0x00FD )
3a54211bd6c4dc3f8687c16020770551cf83a548Teemu Huovila#define IS_VOWEL(c) \
3a54211bd6c4dc3f8687c16020770551cf83a548Teemu Huovila (IS_ASCII_VOWEL(c) || IS_NONASCII_VOWEL(c))
5a2910119ec0b878a0d7ca91918b97e9d40a936dTimo Sirainen#endif