-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbooks.dox
164 lines (160 loc) · 9.06 KB
/
books.dox
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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
/**
* @file books.cpp
* A set of books build a Bible edition. For example, LXX or StatResGNT.
* They contain several books like Genesis and Exodus, or Matthew and Mark (and others).
*/
/// Load and index the default Bible editions wrt. their a-y encoded texts.
/// Currently LXX, SBLGNT and StatResGNT are loaded.
int addBibles();
///
/// Lookup a verse in a Bible edition, in a given book, a given passage.
string lookupVerse(const string& book, const string& info, const string& verse) {
/// @param book The book, e.g. "Genesis".
/// @param info The Bible edition, e.g. "LXX".
/// @param verse The traditionally numbered verse, e.g. "1:1".
};
///
/// Lookup a verse in a Bible edition, in a given book, a given passage.
int lookupVerseStart(const string& book, const string& info, const string& verse) {
/// @param book The book, e.g. "Genesis".
/// @param info The Bible edition, e.g. "LXX".
/// @param verse The traditionally numbered verse, e.g. "1:1".
/// @return The start raw position.
};
///
/// Get the fingerprint of a passage, given with starting position and length.
Fingerprint getTextFingerprint(const string& book, const string& info, int start, int length);
///
/// Get the fingerprint of a passage, given with starting and ending verse by traditional numbering.
Fingerprint getTextFingerprint(const string& book, const string& info, const string& start, const string& end);
///
/// Get the fingerprint of a passage, given with starting and ending verse by traditional numbering and shifts.
Fingerprint getTextFingerprint(const string& book, const string& info, const string& start, const string& end, int startOffset, int endOffset);
/// Compare two passages via fingerprints and their distance.
/// It is computed with a formula \f$(d(p_1,p_2)+1)/(|p_1|+|p_2|)\f$ where the distance of the passages (plus 1)
/// is divided by the sum of the length of the passages.
int compare(const string& book1, const string& info1, const string& verseInfo1s, const string& verseInfo1e, int startOffset1, int endOffset1,
const string& book2, const string& info2, const string& verseInfo2s, const string& verseInfo2e, int startOffset2, int endOffset2) {
/// @param book1 The book of the first passage, e.g. "Genesis".
/// @param info1 The Bible edition of the first passage, e.g. "LXX".
/// @param verseInfo1s The first verse of the first passage by using traditional numbering, e.g. "1:1".
/// @param verseInfo1e The last verse of the first passage by using traditional numbering, e.g. "1:2".
/// @param startOffset1 The shift of the start of the first passage in characters.
/// @param endOffset1 The shift of the end of the first passage in characters.
/// @param book2 The book of the second passage, e.g. "Matthew".
/// @param info2 The Bible edition of the second passage, e.g. "StatResGNT".
/// @param verseInfo2s The first verse of the second passage by using traditional numbering, e.g. "4:10".
/// @param verseInfo2e The last verse of the second passage by using traditional numbering, e.g. "4:12".
/// @param startOffset2 The shift of the start of the second passage in characters.
/// @param endOffset2 The shift of the end of the second passage in characters.
}
/// Compare two passages via fingerprints and their distance.
/// Inputs are given in Greek characters.
int compare(string verse1, string verse2);
/// Compare two passages via fingerprints and their distance.
/// Inputs are given in a-y encoding.
int compareLatin(string verse1, string verse2);
///
/*
/// @deprecated Assume that two passages are in correlation, find their best fit.
int findBestFit(const string& book1, const string& info1, const string& verseInfo1s, const string& verseInfo1e,
const string& book2, const string& info2, const string& verseInfo2s, const string& verseInfo2e);
*/
///
/// Convert raw input verse to a-y encoding.
string processVerse(const string &verse);
///
/// Get text from a given Bible edition, book, passage, with given shifts.
string getText(const string& book, const string& info, const string& VerseInfoS, const string& VerseInfoE, int startOffset, int endOffset) {
/// @param book The book of the passage, e.g. "Genesis".
/// @param info The Bible edition of the passage, e.g. "LXX".
/// @param verseInfoS The first verse of the passage by using traditional numbering, e.g. "1:1".
/// @param verseInfoE The last verse of the passage by using traditional numbering, e.g. "1:2".
/// @param startOffset The shift of the start of the passage in characters.
/// @param endOffset The shift of the end of the passage in characters.
/// @return The requested text.
};
///
/// Find a passage (verbatim) in a Bible edition and return the number of occurrences.
int find(const string& text, const string& moduleName, int maxFound, int verb) {
/// @param text The passage to be found in a-y encoding.
/// @param moduleName The Bible edition to search, e.g. "LXX".
/// @param maxFound The maximal amount of occurrences, then stop.
/// @param verb Request verbose mode (1 if yes).
/// @return the number of occurrences.
};
///
/// Find a minimally unique subtext in the input text.
vector<string> find_min_unique(string text, const string& moduleName, int verb) {
/// @param text The input text in a-y encoding.
/// @param moduleName The Bible edition to search in, e.g. "LXX".
/// @param verb Verbose mode (1 if yes).
};
/// Extend a passage that is unique in another edition to be maximally long, and keep verbatim equality.
/// See https://matek.hu/zoltan/blog-20220131.php for an explanation.
void extend(const string& moduleName1, const string& moduleName2, const string& book2, const string& verse2S,
int start, const string& verse2E, int end) {
/// @param moduleName1 First Bible edition, e.g. "LXX".
/// @param moduleName2 Second Bible edition, different from the first one, e.g. "StatResGNT".
/// @param book2 A book in the second Bible edition, e.g. "Luke".
/// @param verse2S Starting verse in the second Bible edition, e.g. "4:10".
/// @param start Shift in the start of passage in the second Bible edition, e.g. 15.
/// @param verse2E Ending verse in the second Bible edition, e.g. "4:10".
/// @param end Shift in the end of passage in the second Bible edition, e.g. 0.
};
/// Get all possible verbatim quotations of a Bible passage being present in another Bible.
/// See https://matek.hu/zoltan/blog-20220201.php for an explanation.
void getrefs(const string& moduleName2, const string& moduleName1, const string& book1, const string& verse1S,
int start, const string& verse1E, int end) {
/// @param moduleName2 Second Bible edition, e.g. "StatResGNT".
/// @param moduleName1 First Bible edition, e.g. "LXX".
/// @param book1 A book in the first Bible edition, e.g. "Psalms".
/// @param verse1S Starting verse in the second Bible edition, e.g. "82:6".
/// @param start Shift in the start of passage in the first Bible edition, e.g. 0.
/// @param verse1E Ending verse in the first Bible edition, e.g. "82:6".
/// @param end Shift in the end of passage in the first Bible edition, e.g. 0.
};
///
/// Lookup a passage in a given Bible edition.
int lookupTranslation(string moduleName, string book, const string& verse) {
/// @param moduleName A Bible edition, e.g. "LXX".
/// @param book A book in the first Bible edition, e.g. "Psalms".
/// @param verse A verse in the second Bible edition, e.g. "82:6".
/// @return if the lookup was successul.
};
/// Show the installed Bible editions, available via the Sword system.
/// See https://crosswire.org for more information.
void showAvailableBibles();
///
/// Give the number of verses in a Psalm.
int getPsalmLastVerse(const string& moduleName, int psalm) {
/// @param moduleName A Bible edition, e.g. "LXX".
/// @param psalm The Psalm number, e.g. 82.
/// @return The number of verses.
};
/// Get the raw passage text in a-y encoding.
string getRaw(const string& modulename, const string& book, int startPos, int length) {
/// @param moduleName A Bible edition, e.g. "LXX".
/// @param book A book in the give Bible, e.g. "Psalms".
/// @param startPos First position in the a-y encoded text, in characters.
/// @param length Length of the a-y encoded text. If length is -1 and startpos is 0,
/// the whole text is returned.
};
///
/// Convert Latin text to Greek.
string latinToGreek(const string& latin);
/// Get the tokens for a given passage.
int getTokens(const string& moduleName, const string& book, const string& verse) {
/// @param moduleName A Bible edition, e.g. "LXX".
/// @param book A book in the give Bible, e.g. "Psalms".
/// @param verse A verse, given in traditional numbering, e.g. "82:6".
}
/// Search for a token set in a Bible edition.
/// See https://matek.hu/zoltan/blog-20230731.php for more information.
vector<string> searchTokenset(string moduleName, vector<int> pattern, int length, bool verbose) {
/// @param moduleName A Bible edition, e.g. "LXX".
/// @param pattern A set of tokens, insensitive for order.
/// @param length Maximal length of passage to search, in tokens.
/// @param verbose Request verbose mode.
/// @return A vector of strings in format book,tpos (e.g. "Genesis,123") where an occurence is found in book from token position tpos.
}