Compare commits

..

No commits in common. "ce2b8b39c07aa04b74ed2cee397574fe1837599b" and "b9ba894cc94a5b883ea4b30f6aeeede0a8b5f9de" have entirely different histories.

2 changed files with 12 additions and 39 deletions

View File

@ -50,20 +50,15 @@ automatically.
Dictionaries
------------
This application is intended for use with specific dictionaries: each line
should contain one short word definition. Moreover, the only supported content
types are plain text, Pango markup, and XDXF (the visual format works better).
Unfortunately, this application only really works with specific dictionaries.
Word definitions have to be in plain text, separated by newlines.
The `make dicts` command will build some examples from freely available sources:
The `make dicts` command will build some examples from freely available sources.
- GNU/FDL Czech-English dictionary
- Czech foreign words
- Czech WordNet 1.9 PDT (synonyms, hypernyms, hyponyms)
You can use the included 'transform' tool to convert already existing StarDict
dictionaries that are nearly good as they are. Remember that you can change
the `sametypesequence` of the resulting '.ifo' file to another format, or run
'dictzip' on '.dict' files to make them compact.
You may use the included 'transform' tool to convert already existing
dictionaries that are almost good as they are, e.g., after stripping XML tags.
You might want to fix up the `sametypesequence` of the resulting '.ifo' file
afterwards, and run 'dictzip' on the resulting '.dict' file to make it compact.
https://mega.co.nz/#!axtD0QRK!sbtBgizksyfkPqKvKEgr8GQ11rsWhtqyRgUUV0B7pwg[CZ <--> EN/DE/PL/RU dictionaries]
@ -71,10 +66,12 @@ Further Development
-------------------
While I've been successfully using 'sdtui' for many years now, some work has to
be done yet before the software can be considered fit for inclusion in regular
Linux and/or BSD distributions:
Linux and/or BSD distributions.
- The tab bar and the text input field don't handle overflows well.
- Lacking configuration, standard StarDict locations should be scanned.
An approximate list of things that need to be resolved is as follows:
- the tab bar and the text input field don't handle overflows well,
- figure out a way to become capable of displaying most StarDict dictionaries.
Given the entangledness of this codebase, issues with the file format,
and general undesirability of terminal UIs, it might be better to start anew.

View File

@ -344,26 +344,6 @@ view_entry_split_add_pango (ViewEntry *ve, const gchar *markup)
g_free (text);
}
static void
view_entry_split_add_xdxf (ViewEntry *ve, const gchar *xml)
{
// Trivially filter out all tags we can't quite handle,
// then parse the reduced XML as Pango markup--this seems to work well.
// Given the nature of our display, also skip keyword elements.
GString *filtered = g_string_new ("");
while (*xml)
{
const gchar *p = NULL;
if (*xml != '<' || !*(p = xml + 1 + (xml[1] == '/'))
|| (strchr ("biu", *p) && p[1] == '>') || !(p = strchr (p, '>')))
g_string_append_c (filtered, *xml++);
else if (xml[1] != 'k' || xml[2] != '>' || !(xml = strstr (p, "</k>")))
xml = ++p;
}
view_entry_split_add_pango (ve, filtered->str);
g_string_free (filtered, TRUE);
}
/// Decomposes a dictionary entry into the format we want.
static ViewEntry *
view_entry_new (StardictIterator *iterator)
@ -392,10 +372,6 @@ view_entry_new (StardictIterator *iterator)
view_entry_split_add_pango (ve, field->data);
found_anything_displayable = TRUE;
break;
case STARDICT_FIELD_XDXF:
view_entry_split_add_xdxf (ve, field->data);
found_anything_displayable = TRUE;
break;
case STARDICT_FIELD_PHONETIC:
g_string_append_printf (word, " /%s/", (const gchar *) field->data);
break;