42 fprintf (stderr,
"Copyright 1999-2018 by the CrossWire Bible Society\n");
43 fprintf (stderr,
"http://www.crosswire.org/sword/diatheke/\n");
44 fprintf (stderr,
"\n");
45 fprintf (stderr,
"usage: diatheke <-b module_name> [-s search_type] [-r search_range]\n");
46 fprintf (stderr,
" [-o option_filters] [-m maximum_verses] [-f output_format]\n");
47 fprintf (stderr,
" [-e output_encoding] [-v variant#(-1=all|0|1)]\n");
48 fprintf (stderr,
" [-l locale] <-k query_key>\n");
49 fprintf (stderr,
"\n");
50 fprintf (stderr,
"If <book> is \"system\" you may use these system keys: \"modulelist\",\n");
51 fprintf (stderr,
"\"modulelistnames\", \"bibliography\", and \"localelist\".");
52 fprintf (stderr,
"\n");
53 fprintf (stderr,
"Valid search_type values are: phrase , regex, multiword, attribute,\n");
54 fprintf (stderr,
" lucene, multilemma.\n");
55 fprintf (stderr,
"Valid (output) option_filters values are: n (Strong's numbers),\n");
56 fprintf (stderr,
" f (Footnotes), m (Morphology), h (Section Headings),\n");
57 fprintf (stderr,
" c (Cantillation), v (Hebrew Vowels), a (Greek Accents), p (Arabic Vowels)\n");
58 fprintf (stderr,
" l (Lemmas), s (Scripture Crossrefs), r (Arabic Shaping),\n");
59 fprintf (stderr,
" b (Bi-Directional Reordering), w (Red Words of Christ),\n");
60 fprintf (stderr,
" g (Glosses/Ruby), e (Word Enumerations), i (Intros)\n");
61 fprintf (stderr,
" x (Encoded Transliterations), t (Algorithmic Transliterations via ICU),\n");
62 fprintf (stderr,
" M (morpheme segmentation)\n");
64 fprintf (stderr,
"Maximum verses may be any integer value\n");
65 fprintf (stderr,
"Valid output_format values are: CGI, GBF, HTML, HTMLHREF, LaTeX, OSIS, RTF,\n");
66 fprintf (stderr,
" ThML, WEBIF, XHTML, plain, and internal (def)\n");
67 fprintf (stderr,
"The option LaTeX will produce a compilable document, but may well require\n");
68 fprintf (stderr,
" tweaking to be usable.\n");
69 fprintf (stderr,
"Valid output_encoding values are: Latin1, UTF8 (def), UTF16, HTML, RTF, and SCSU\n");
70 fprintf (stderr,
"Valid locale values depend on installed locales. en is default.\n");
71 fprintf (stderr,
"The query_key must be the last argument because all following\n");
72 fprintf (stderr,
" arguments are added to the key.\n");
73 fprintf (stderr,
"\n");
74 fprintf (stderr,
"Example usage:\n");
75 fprintf (stderr,
" diatheke -b KJV -o fmnx -k Jn 3:16\n");
76 fprintf (stderr,
" diatheke -b WHNU -t Latin -o mn -k Mt 24\n");
77 fprintf (stderr,
" diatheke -b KJV -s phrase -r Mt -k love\n");
82 int main(
int argc,
char **argv)
86 unsigned long optionfilters =
OP_NONE;
87 char *text = 0, *locale = 0, *ref = 0, *
range = 0;
88 char script[] =
"Latin";
89 signed short variants = 0;
94 for (
int i = 1; i < argc; ++i) {
95 if (!::
stricmp(
"-b", argv[i])) {
102 else if (!::
stricmp(
"-s", argv[i])) {
105 if (!::
stricmp(
"phrase", argv[i])) {
108 else if (!::
stricmp(
"regex", argv[i])) {
111 else if (!::
stricmp(
"multiword", argv[i])) {
114 else if (!::
stricmp(
"lucene", argv[i])) {
117 else if (!::
stricmp(
"attribute", argv[i])) {
120 else if (!::
stricmp(
"multilemma", argv[i])) {
124 fprintf (stderr,
"Unknown search_type: %s\n", argv[i]);
125 fprintf (stderr,
"Try diatheke --help\n");
130 else if (!::
stricmp(
"-r", argv[i])) {
136 else if (!::
stricmp(
"-l", argv[i])) {
142 else if (!::
stricmp(
"-m", argv[i])) {
145 maxverses = atoi(argv[i]);
148 else if (!::
stricmp(
"-o", argv[i])) {
151 if (strchr(argv[i],
'f'))
153 if (strchr(argv[i],
'n'))
155 if (strchr(argv[i],
'h'))
157 if (strchr(argv[i],
'm'))
159 if (strchr(argv[i],
'c'))
161 if (strchr(argv[i],
'v'))
163 if (strchr(argv[i],
'a'))
165 if (strchr(argv[i],
'l'))
167 if (strchr(argv[i],
's'))
169 if (strchr(argv[i],
'r'))
171 if (strchr(argv[i],
'b'))
173 if (strchr(argv[i],
'w'))
175 if (strchr(argv[i],
'p'))
177 if (strchr(argv[i],
'g'))
179 if (strchr(argv[i],
'x'))
181 if (strchr(argv[i],
'e'))
183 if (strchr(argv[i],
'i'))
185 if (strchr(argv[i],
't'))
187 if (strchr(argv[i],
'M'))
191 else if (!::
stricmp(
"-f", argv[i])) {
194 if (!::
stricmp(
"thml", argv[i])) {
197 else if (!::
stricmp(
"cgi", argv[i])) {
200 else if (!::
stricmp(
"gbf", argv[i])) {
203 else if (!::
stricmp(
"htmlhref", argv[i])) {
206 else if (!::
stricmp(
"html", argv[i])) {
209 else if (!::
stricmp(
"xhtml", argv[i])) {
212 else if (!::
stricmp(
"rtf", argv[i])) {
215 else if (!::
stricmp(
"osis", argv[i])) {
218 else if (!::
stricmp(
"latex", argv[i])) {
221 else if (!::
stricmp(
"plain", argv[i])) {
224 else if (!::
stricmp(
"webif", argv[i])) {
227 else if (!::
stricmp(
"internal", argv[i])) {
232 else if (!::
stricmp(
"-e", argv[i])) {
235 if (!::
stricmp(
"utf8", argv[i])) {
238 else if (!::
stricmp(
"rtf", argv[i])) {
241 else if (!::
stricmp(
"html", argv[i])) {
244 else if (!::
stricmp(
"latin1", argv[i])) {
247 else if (!::
stricmp(
"utf16", argv[i])) {
250 else if (!::
stricmp(
"scsu", argv[i])) {
255 else if (!::
stricmp(
"-k", argv[i])) {
260 for (; i < argc; ++i) {
263 key = key +
" " + argv[i];
265 ref =
new char[key.length() + 1];
266 strcpy (ref, key.c_str());
271 else if (!::
stricmp(
"-v", argv[i])) {
274 variants = atoi(argv[i]);
296 doquery(maxverses, outputformat, outputencoding, optionfilters, searchtype,
range, text, locale, ref, &cout, script, variants);
int stricmp(const char *s1, const char *s2)
#define OP_REDLETTERWORDS
static SWVersion currentVersion
void doquery(unsigned long maxverses=-1, unsigned char outputformat=FMT_PLAIN, unsigned char outputencoding=ENC_UTF8, unsigned long optionfilters=0, unsigned char searchtype=ST_NONE, const char *range=0, const char *text=0, const char *locale=0, const char *ref=0, ostream *output=&cout, const char *script=0, signed char variants=0)
#define OP_TRANSLITERATOR