Am 31.05.2010 um 12:36 schrieb Jean-Marc LASGOUTTES: > Stephan Witt <st.w...@gmx.net> writes: >> The dictionaries are arch independent AFAIK. So the question is where to >> store and how to install them. >> The logical place would be lyx-devel/lib/dict and lyx-devel/lib/thes. But >> this is in SVN-tree... > > Installing them at this place does not mean that we have to have them in > svn at this place.
That's the current situation. I have them private and copy them to the final result. Strictly speaking the result is undefined. That's why I'm interested in good proposals here. Am 31.05.2010 um 13:00 schrieb Jean-Marc LASGOUTTES: Thanks for commenting! > Stephan Witt <st.w...@gmx.net> writes: >> I've prepared a patch to change hunspell and myThes wrappers to be ready for >> included dictionaries. >> Please have a look at the patch and point me to typos and thinkos. >> With the changes the binary searches the data files in this order: >> 1. user path from configuration >> 2. user support directory and >> 3. system support directory - there will the shipped data files live. > > A few remarks below. > I am a bit lost about what happens in getConfig primarily... It is a sophisticated version of new_aspell_config() now. But at the moment for Apple builds only. I'll change that... see below. > > JMarc > >> +#ifndef THESAURUS_LOCATION >> +# define THESAURUS_LOCATION "thes" >> +#endif > > Please refrain from using #defines. I do not think this particular one > is useful. I know that defines are bad. But here I don't know how to make the used location clear. The alternative is a local const string in method pair<string,string> Thesaurus::Private::getThesaurus(docstring const & lang) around line 120 of src/Thesaurus.cpp That's pretty far away of the beginning of the file. Any idea? Currently the Aspell code is not working for i386 builds on x86_64 platform :( You're right that AspellChecker.cpp is subject to correct. I want to do it like in HunspellChecker.cpp after the fix of aspell library. Unfortunately I got no response from Kevin Atkinson - so I don't know if I can fix it alone. I suspect it is some UINT_MAX issue... But of course I can fix the wrapper in AspellChecker.cpp first. That's better in any case. Stephan > >> Index: src/AspellChecker.cpp >> =================================================================== > >> +# ifndef ASPELL_FRAMEWORK >> +# define ASPELL_FRAMEWORK "Aspell.framework" >> +# endif > > I would be better to define this default in the configure script. > >> +# ifndef ASPELL_FRAMEWORK_DATA >> +# define ASPELL_FRAMEWORK_DATA "/Resources/data" >> +# endif >> +# ifndef ASPELL_FRAMEWORK_DICT >> +# define ASPELL_FRAMEWORK_DICT "/Resources/dict" >> +# endif >> + >> +# ifndef ASPELL_MACPORTS >> +# define ASPELL_MACPORTS "/opt/local" >> +# endif >> +# ifndef ASPELL_MACPORTS_DATA >> +# define ASPELL_MACPORTS_DATA "/lib/aspell-0.60" >> +# endif >> +# ifndef ASPELL_MACPORTS_DICT >> +# define ASPELL_MACPORTS_DICT "/share/aspell" >> +# endif > > Here also, I think the configure script is the right place to determine > which places may contain dictionaries. Moreover, this code may be more > platform dependent. > >> struct Speller { >> - AspellSpeller * speller; >> + ///AspellSpeller * speller; > > Just delete it if it is not used. > >> +bool checkAspellData(AspellConfig * config, >> + char const * basepath, char const * datapath, char const * dictpath, >> + string const & lang, string const & variety) > > Why use char const * here? Please stick to string for interfeces unless > really necessary. > >> +AspellConfig * getConfig(string const & lang, >> + string const & variety) > > Note that all the free-standing functions should be in an anonymous > namespace. > >> +{ >> AspellConfig * config = new_aspell_config(); >> #ifdef __APPLE__ > > Try to find a way to avoid as much as possible this __APPLE__ special > casing. Most of the code you have here can be useful to all platforms. > >> + char const * sysdir = >> lyx::support::package().system_support().absFileName().c_str() ; >> + char const * userdir = >> lyx::support::package().user_support().absFileName().c_str() ; > > These variables are not used in the rest of the function... But I would > like them to be used :) > >> + char const * framework = ASPELL_FRAMEWORK ; >> >> - if ( strlen(framework) && getPrivateFrameworkPathName(buf, sizeof(buf), >> framework) ) { > > Please, only std::string !