-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrdi_buckwalter_conversions.h
57 lines (46 loc) · 2.61 KB
/
rdi_buckwalter_conversions.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
#ifndef BUCKWALTER_CONVERSIONS_H
#define BUCKWALTER_CONVERSIONS_H
#include <string>
#include <vector>
namespace RDI
{
extern "C++"
{
/// Converts Arabic to Buckwalter
/// Any non-arab characters will be ignored completely and the resulting buckwalter string will not contain them
std::string convert_arabic_to_buckwalter_remove_unknown(std::wstring arabic);
/// Converts Arabic to Buckwalter
/// replace any non-arab characters with "<UNK>"
std::string convert_arabic_to_buckwalter(std::wstring arabic);
/// Converts Arabic to Buckwalter
/// replace each non-arab characters with "!" with a list of the opposite countinuous non-arabic chars
/// save list of any non-arab characters in unkown_chars
/// save list of continuous spaces in spaces
/// save a list of arabic formation he found in the text in orignal_letter_formarion
/// return a backwalter line with unknown and without tahkeel
std::string convert_arabic_to_buckwalter_no_tahkeel(std::wstring arabic,std::vector<std::wstring>& unkown_chars ,
std::vector<std::wstring>& spaces , std::vector<std::string>& orignal_letter_formarion);
/// Converts Buckwalter to Arabic
/// If given any letters that are not defined in the buckwalter specification they
/// will be erased from the resulting wstring
std::wstring convert_buckwalter_to_arabic(std::string buckwlater);
/// Converts Buckwalter to Arabic
/// recover the unkowns charchaters using it's orginal symbol list
/// If given any letters that are not defined in the buckwalter specification they
/// will be erased from the resulting wstring
std::wstring convert_buckwalter_to_arabic(std::string buckwlater,const std::vector<std::wstring>& orignal_unknowns,const std::vector<std::wstring>& orignal_wspaces);
/// Same as above but it does not any letters that are not defined
/// in the buckwalter specification (except for the tashkeel)
/// will be erased from the result
std::wstring convert_buckwalter_to_arabic_no_tashkeel(std::string buckwlater);
/// Any unknown character will be discarded
std::string convert_buckwalter_to_buckwalter_without_tashkeel(std::string buckwalter);
/// Any unknown character will be discarded
std::wstring convert_arabic_to_arabic_without_tashkeel(std::wstring arabic_with_tashkeel);
///check if the line is not empty or all characters is out of arabic letters
bool is_vaild_line(std::wstring &input);
///check if all arabic letters have formate and the user need to keep formattions
bool is_arabic_all_letters_fromated(std::wstring &input,bool keep_orignal_formation);
}
}
#endif // BUCKWALTER_CONVERSIONS_H