Commit e6183d2d authored by twanvl's avatar twanvl

Simple spelling checker using the Hunspell library.

Currently the checker is only exposed through the script function check_spelling_word, which returns true if the word is spelled correctly.
parent d80a8cc9
SET ISO8859-1
TRY esianrtolcdugmphbyfvkwzESIANRTOLCDUGMPHBYFVKWZ
PFX A Y 1
PFX A 0 re .
PFX I Y 1
PFX I 0 in .
PFX U Y 1
PFX U 0 un .
PFX C Y 1
PFX C 0 de .
PFX E Y 1
PFX E 0 dis .
PFX F Y 1
PFX F 0 con .
PFX K Y 1
PFX K 0 pro .
SFX V N 2
SFX V e ive e
SFX V 0 ive [^e]
SFX N Y 3
SFX N e ion e
SFX N y ication y
SFX N 0 en [^ey]
SFX X Y 3
SFX X e ions e
SFX X y ications y
SFX X 0 ens [^ey]
SFX H N 2
SFX H y ieth y
SFX H 0 th [^y]
SFX Y Y 1
SFX Y 0 ly .
SFX G Y 2
SFX G e ing e
SFX G 0 ing [^e]
SFX J Y 2
SFX J e ings e
SFX J 0 ings [^e]
SFX D Y 4
SFX D 0 d e
SFX D y ied [^aeiou]y
SFX D 0 ed [^ey]
SFX D 0 ed [aeiou]y
SFX T N 4
SFX T 0 st e
SFX T y iest [^aeiou]y
SFX T 0 est [aeiou]y
SFX T 0 est [^ey]
SFX R Y 4
SFX R 0 r e
SFX R y ier [^aeiou]y
SFX R 0 er [aeiou]y
SFX R 0 er [^ey]
SFX Z Y 4
SFX Z 0 rs e
SFX Z y iers [^aeiou]y
SFX Z 0 ers [aeiou]y
SFX Z 0 ers [^ey]
SFX S Y 4
SFX S y ies [^aeiou]y
SFX S 0 s [aeiou]y
SFX S 0 es [sxzh]
SFX S 0 s [^sxzhy]
SFX P Y 3
SFX P y iness [^aeiou]y
SFX P 0 ness [aeiou]y
SFX P 0 ness [^y]
SFX M Y 1
SFX M 0 's .
SFX B Y 3
SFX B 0 able [^aeiou]
SFX B 0 able ee
SFX B e able [^aeiou]e
SFX L Y 1
SFX L 0 ment .
REP 88
REP a ei
REP ei a
REP a ey
REP ey a
REP ai ie
REP ie ai
REP are air
REP are ear
REP are eir
REP air are
REP air ere
REP ere air
REP ere ear
REP ere eir
REP ear are
REP ear air
REP ear ere
REP eir are
REP eir ere
REP ch te
REP te ch
REP ch ti
REP ti ch
REP ch tu
REP tu ch
REP ch s
REP s ch
REP ch k
REP k ch
REP f ph
REP ph f
REP gh f
REP f gh
REP i igh
REP igh i
REP i uy
REP uy i
REP i ee
REP ee i
REP j di
REP di j
REP j gg
REP gg j
REP j ge
REP ge j
REP s ti
REP ti s
REP s ci
REP ci s
REP k cc
REP cc k
REP k qu
REP qu k
REP kw qu
REP o eau
REP eau o
REP o ew
REP ew o
REP oo ew
REP ew oo
REP ew ui
REP ui ew
REP oo ui
REP ui oo
REP ew u
REP u ew
REP oo u
REP u oo
REP u oe
REP oe u
REP u ieu
REP ieu u
REP ue ew
REP ew ue
REP uff ough
REP oo ieu
REP ieu oo
REP ier ear
REP ear ier
REP ear air
REP air ear
REP w qu
REP qu w
REP z ss
REP ss z
REP shun tion
REP shun sion
REP shun cion
This diff is collapsed.
......@@ -43,7 +43,7 @@
Name="VCCustomBuildTool"/>
<Tool
Name="VCLinkerTool"
AdditionalDependencies="rpcrt4.lib wsock32.lib comctl32.lib wxbase$(WX_VERSION)d.lib wxmsw$(WX_VERSION)d_core.lib wxjpegd.lib wxpngd.lib wxtiffd.lib wxzlibd.lib wxregexd.lib wxbase$(WX_VERSION)d_net.lib wxmsw$(WX_VERSION)d_html.lib"
AdditionalDependencies="rpcrt4.lib wsock32.lib comctl32.lib wxbase$(WX_VERSION)d.lib wxmsw$(WX_VERSION)d_core.lib wxjpegd.lib wxpngd.lib wxtiffd.lib wxzlibd.lib wxregexd.lib wxbase$(WX_VERSION)d_net.lib wxmsw$(WX_VERSION)d_html.lib libhunspelld.lib"
OutputFile="$(OutDir)/mse.exe"
LinkIncremental="2"
IgnoreDefaultLibraryNames="libcd.lib,libcid.lib"
......@@ -116,7 +116,7 @@
Name="VCCustomBuildTool"/>
<Tool
Name="VCLinkerTool"
AdditionalDependencies="rpcrt4.lib wsock32.lib comctl32.lib wxbase$(WX_VERSION).lib wxmsw$(WX_VERSION)_core.lib wxjpeg.lib wxpng.lib wxtiff.lib wxzlib.lib wxregex.lib wxbase$(WX_VERSION)_net.lib wxmsw$(WX_VERSION)_html.lib"
AdditionalDependencies="rpcrt4.lib wsock32.lib comctl32.lib wxbase$(WX_VERSION).lib wxmsw$(WX_VERSION)_core.lib wxjpeg.lib wxpng.lib wxtiff.lib wxzlib.lib wxregex.lib wxbase$(WX_VERSION)_net.lib wxmsw$(WX_VERSION)_html.lib libhunspell.lib"
OutputFile="$(OutDir)/mse.exe"
LinkIncremental="1"
SuppressStartupBanner="TRUE"
......@@ -187,7 +187,7 @@
Name="VCCustomBuildTool"/>
<Tool
Name="VCLinkerTool"
AdditionalDependencies="rpcrt4.lib wsock32.lib comctl32.lib wxbase$(WX_VERSION)ud.lib wxmsw$(WX_VERSION)ud_core.lib wxjpegd.lib wxpngd.lib wxtiffd.lib wxzlibd.lib wxregexud.lib wxbase$(WX_VERSION)ud_net.lib wxmsw$(WX_VERSION)ud_html.lib libboost_regex-vc71-mt-gd-1_36.lib"
AdditionalDependencies="rpcrt4.lib wsock32.lib comctl32.lib wxbase$(WX_VERSION)ud.lib wxmsw$(WX_VERSION)ud_core.lib wxjpegd.lib wxpngd.lib wxtiffd.lib wxzlibd.lib wxregexud.lib wxbase$(WX_VERSION)ud_net.lib wxmsw$(WX_VERSION)ud_html.lib libboost_regex-vc71-mt-gd-1_36.lib libhunspelld.lib"
OutputFile="$(OutDir)/mse.exe"
LinkIncremental="2"
IgnoreDefaultLibraryNames="libcd.lib,libcid.lib"
......@@ -263,7 +263,7 @@
Name="VCCustomBuildTool"/>
<Tool
Name="VCLinkerTool"
AdditionalDependencies="rpcrt4.lib wsock32.lib comctl32.lib wxbase$(WX_VERSION)u.lib wxmsw$(WX_VERSION)u_core.lib wxjpeg.lib wxpng.lib wxtiff.lib wxzlib.lib wxregexu.lib wxbase$(WX_VERSION)u_net.lib wxmsw$(WX_VERSION)u_html.lib"
AdditionalDependencies="rpcrt4.lib wsock32.lib comctl32.lib wxbase$(WX_VERSION)u.lib wxmsw$(WX_VERSION)u_core.lib wxjpeg.lib wxpng.lib wxtiff.lib wxzlib.lib wxregexu.lib wxbase$(WX_VERSION)u_net.lib wxmsw$(WX_VERSION)u_html.lib libhunspell.lib"
OutputFile="$(OutDir)/mse.exe"
LinkIncremental="1"
SuppressStartupBanner="TRUE"
......@@ -420,7 +420,7 @@
Name="VCCustomBuildTool"/>
<Tool
Name="VCLinkerTool"
AdditionalDependencies="rpcrt4.lib wsock32.lib comctl32.lib wxbase$(WX_VERSION)u.lib wxmsw$(WX_VERSION)u_core.lib wxjpeg.lib wxpng.lib wxtiff.lib wxzlib.lib wxregexu.lib wxbase$(WX_VERSION)u_net.lib wxmsw$(WX_VERSION)u_html.lib libboost_regex-vc71-mt-s.lib"
AdditionalDependencies="rpcrt4.lib wsock32.lib comctl32.lib wxbase$(WX_VERSION)u.lib wxmsw$(WX_VERSION)u_core.lib wxjpeg.lib wxpng.lib wxtiff.lib wxzlib.lib wxregexu.lib wxbase$(WX_VERSION)u_net.lib wxmsw$(WX_VERSION)u_html.lib libboost_regex-vc71-mt-s.lib libhunspell.lib"
OutputFile="$(OutDir)/mse.exe"
LinkIncremental="1"
SuppressStartupBanner="TRUE"
......@@ -2304,6 +2304,12 @@
<File
RelativePath=".\util\regex.hpp">
</File>
<File
RelativePath=".\util\spell_checker.cpp">
</File>
<File
RelativePath=".\util\spell_checker.hpp">
</File>
<File
RelativePath=".\util\vector2d.hpp">
</File>
......@@ -2741,6 +2747,9 @@
<File
RelativePath=".\script\functions\regex.cpp">
</File>
<File
RelativePath=".\script\functions\spelling.cpp">
</File>
<File
RelativePath=".\script\functions\util.hpp">
</File>
......@@ -3938,6 +3947,13 @@
RelativePath=".\cli\text_io_handler.hpp">
</File>
</Filter>
<Filter
Name="tests"
Filter="">
<File
RelativePath="..\data\magic-test.mse-style\script-language-tests">
</File>
</Filter>
<File
RelativePath=".\code_template.cpp">
<FileConfiguration
......
......@@ -26,6 +26,7 @@ void init_script_image_functions(Context& ctx);
void init_script_editor_functions(Context& ctx);
void init_script_export_functions(Context& ctx);
void init_script_english_functions(Context& ctx);
void init_script_spelling_functions(Context& ctx);
void init_script_construction_functions(Context& ctx);
/// Initialize all built in functions for a context
......@@ -36,6 +37,7 @@ inline void init_script_functions(Context& ctx) {
init_script_editor_functions(ctx);
init_script_export_functions(ctx);
init_script_english_functions(ctx);
init_script_spelling_functions(ctx);
init_script_construction_functions(ctx);
}
......
......@@ -27,6 +27,7 @@ Variable string_to_variable(const String& s) {
if (it == variables.end()) {
#ifdef _DEBUG
variable_names.push_back(s);
assert(s == cannocial_name_form(s)); // only use cannocial names
#endif
Variable v = (Variable)variables.size();
variables.insert(make_pair(s,v));
......
......@@ -120,6 +120,12 @@ InputStreamP PackageManager::openFileFromPackage(Packaged*& package, const Strin
throw FileNotFoundError(name, _("No package name specified, use '/package/filename'"));
}
String PackageManager::getDictionaryDir(bool l) const {
String dir = (l ? local : global).getDirectory();
if (dir.empty()) return wxEmptyString;
else return dir + _("/dictionaries/");
}
// ----------------------------------------------------------------------------- : PackageManager : on disk
bool PackageManager::checkDependency(const PackageDependency& dep, bool report_errors) {
......
......@@ -70,6 +70,9 @@ class PackageDirectory {
/// Does a package with the given name exist?
bool exists(const String& name) const;
/// Get the package directory
inline String getDirectory() const { return directory; }
/// Find all packages that match a filename pattern (using wxFindFirst)
String findFirstMatching(const String& pattern) const;
......@@ -161,6 +164,11 @@ class PackageManager {
/// Install/uninstall a package, returns success
bool install(const InstallablePackage& package);
// --------------------------------------------------- : Other package like things
/// Get the directory for dictionary files
String getDictionaryDir(bool local) const;
// --------------------------------------------------- : Packages on a server
private:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment