Commit Graph

31 Commits

Author SHA1 Message Date
Aleksa Sarai
51338ac5bb lookup: do not bail on first failed lookup with a word list
Due to the lack of deinflection support in StarDict, users might want to
be able to create a list of possible deinflections and search each one
to see if there is a dictionary entry for that deinflection.

Being able to do this in one sdcv invocation is far more preferable to
calling sdcv once for each candidate due to the performance cost of
doing so. The most obvious language that would benefit from this is
Japanese, but I'm sure other folks would prefer this.

In order to make this use-case better supported -- try to look up every
word in the provided list of words before existing with an error if any
one of the words failed to be looked up.

Signed-off-by: Aleksa Sarai <cyphar@cyphar.com>
2021-09-29 03:28:44 +10:00
258204
c7d9944f7d Added --json (same as --json-output) to match man 2021-06-19 19:19:31 -06:00
NiLuJe
3b26731b02 Making glib thinks it's a filename instead of a string prevents the
initial UTF-8 conversion

At least on POSIX.

Windows is another kettle of fish. But then it was probably already
broken there.
2021-01-14 19:26:06 +01:00
NiLuJe
070a9fb0bd Oh, well, dirty hackery it is, then.
the previous approachonly works as long as locales are actually sane
(i.e., the test only passes if you *actually* have the ru_RU.KOI8-R
locale built, which the CI doesn't).
2021-01-12 04:37:07 +01:00
NiLuJe
25768c6b80 Handle "rest" arguments the glib way
Ensures the "stop parsing" token (--) is handled properly.
2021-01-12 03:35:55 +01:00
Evgeniy A. Dushistov
7facbe215e refactoring: run clang-format against code 2020-08-14 12:36:02 +03:00
Guido Cella
2fd47ba0d0 Keep searching in $HOME 2020-05-10 12:48:32 +02:00
Guido Cella
3413d847c5 Comply with the XDG Base Directory Specification 2020-05-10 07:01:31 +02:00
alcah
021e467b37 return exit code 2 if search term not found 2020-03-17 22:15:16 +10:30
Evgeniy A. Dushistov
0cd29823cf ready for 0.5.2 release 2017-08-16 10:14:23 +03:00
Evgeniy A. Dushistov
8f16ceae59 refactoring: apply clang-format rules 2017-08-09 07:46:27 +03:00
Peter
e85927e562 Add -e for exact searches (no fuzzy matches).
Only exact matches (or synonyms) are returned for simple searches.
2017-07-28 11:39:34 +02:00
Evgeniy Dushistov
af6362f5df Merge pull request #23 from sleep-walker/master
fix FSF address in LICENSE
2017-07-27 00:30:30 +03:00
Tomáš Čech
98e98d0746 fix FSF address 2017-07-26 22:39:28 +02:00
Peter
3105823e8b Add option --json-output (-j)
If given -j, format the output of -l and of searches as JSON.
2017-07-26 22:07:23 +02:00
Peter
5f0f6e036f Add option --only-data-dir (-x)
Only use the dictionaries in data-dir, do not search in user and system directories

This makes testing much easier
2017-07-07 08:39:26 +02:00
Evgeniy A. Dushistov
b2ced870ab fix potential undefined behaviour
fix #19
2017-07-04 22:33:14 +03:00
Evgeniy A. Dushistov
1667de0650 cleanups for specify "dictionary order by" 2017-04-22 21:23:00 +03:00
Cong Gu
2d95bd0b12 specify dictionary order by -u switches or ~/.sdcv_ordering 2016-09-25 01:13:43 -05:00
Evgeniy A. Dushistov
aa0c5ff051 add clang-format and apply to sdcv.cpp 2016-06-02 14:52:58 +03:00
Evgeniy Dushistov
8298a578b0 check fread calls 2013-07-07 23:29:09 +00:00
Evgeniy Dushistov
a1f5ebeee2 remove typedef to simplify code 2013-07-07 15:24:28 +00:00
Evgeniy Dushistov
f5c62baeb9 support of usage colors in sdcv output 2013-07-07 14:43:53 +00:00
Evgeniy Dushistov
7ddc3e2ea9 - update russiang translation and po template
- remove not used file
2013-07-07 13:11:54 +00:00
Evgeniy Dushistov
edfee97db3 sdcv.cpp: use c++11 where possible 2013-07-06 22:37:42 +00:00
Evgeniy Dushistov
5f43a6dae6 - remove generated files *.gmo
- remove not used Makefile.am
- fix work with translated messages
- make package and make install fixes
2013-07-06 20:04:22 +00:00
Evgeniy Dushistov
dd9304951f remove autotools stuff, now sdcv uses cmake 2013-07-06 18:36:42 +00:00
Evgeniy Dushistov
0d7afe20af may be fix for: 'libintl_setlocale' is not a member of 'std'
get from here:
https://trac.macports.org/browser/trunk/dports/textproc/sdcv/files/patch-setlocale.diff?rev=85010
2013-07-06 13:00:22 +00:00
Evgeniy Dushistov
502e845105 Import Volkov Peter ( volkov_peter )'s patch:
sdcv uses g_get_home_dir function to find home directory. That function uses passwd entry and this in turn breaks expectations of users and automatic tests inside sandbox where access behind some directory is not allowed (and thus tests are not allowed to write into /root/.stardict/dic...) The patch in attachment fixes this basically by using code from gnome manual:


http://library.gnome.org/devel/glib/stable/glib-Miscellaneous-Utility-Functions.html#g-get-home-dir

const char *homedir = g_getenv ("HOME");
if (!homedir)
homedir = g_get_home_dir ();
2010-08-01 21:00:33 +00:00
Evgeniy Dushistov
c7c8dab8db get rid of getopt, because of it cause problem on mac os x. 2007-09-30 18:10:19 +00:00
Evgeniy Dushistov
3f241bb6bb 0.4.2 release 2007-08-14 18:18:20 +00:00