summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorchenxiajian <chenxiajian1985@gmail.com>2011-08-11 15:48:55 +0000
committerchenxiajian <chenxiajian1985@gmail.com>2011-08-11 15:48:55 +0000
commite22280b82f4077763dc0aabad17fb027130ab48d (patch)
treea8891c96dccfc3e54ab3d9b5beaca0956dde2be2
parented989817528a088940a38c817797569fb0fb9625 (diff)
downloadenchant-e22280b82f4077763dc0aabad17fb027130ab48d.tar.gz
Enchant Hyphenate support in .NET (Some build bugs)
git-svn-id: svn+ssh://svn.abisource.com/svnroot/enchant/branches/gsoc2011hyphenation@30164 bcba8976-2d24-0410-9c9c-aab3bd5fdfd6
-rw-r--r--src/bindings/Enchant.Net/Bindings.cs16
-rw-r--r--src/bindings/Enchant.Net/Dictionary.cs10
-rw-r--r--src/bindings/Enchant.Net/Enchant.Net.csproj7
3 files changed, 32 insertions, 1 deletions
diff --git a/src/bindings/Enchant.Net/Bindings.cs b/src/bindings/Enchant.Net/Bindings.cs
index acc150b..5858214 100644
--- a/src/bindings/Enchant.Net/Bindings.cs
+++ b/src/bindings/Enchant.Net/Bindings.cs
@@ -227,6 +227,22 @@ namespace Enchant
return result;
}
+ [DllImport(ENCHANT_LIBRARY, CallingConvention = CallingConvention.Cdecl)]
+ private static extern IntPtr enchant_dict_hyphenate(SafeDictionaryHandle dict,
+ IntPtr word,
+ int len);
+
+ public static string enchant_dict_hyphenate(SafeDictionaryHandle dict, string word,int len)
+ {
+ string result;
+ using (Utf8Marshaller utf8Word = new Utf8Marshaller(word))
+ {
+ result =
+ enchant_dict_suggest(dict,word,len);
+ }
+ return result;
+ }
+
[DllImport(ENCHANT_LIBRARY, CallingConvention = CallingConvention.Cdecl)]
private static extern void enchant_dict_free_string_list(SafeDictionaryHandle dict,
IntPtr string_list);
diff --git a/src/bindings/Enchant.Net/Dictionary.cs b/src/bindings/Enchant.Net/Dictionary.cs
index e219210..72fe24d 100644
--- a/src/bindings/Enchant.Net/Dictionary.cs
+++ b/src/bindings/Enchant.Net/Dictionary.cs
@@ -130,6 +130,16 @@ namespace Enchant
return Bindings.enchant_dict_suggest(_handle, word);
}
+ public string Hyphenate(string word)
+ {
+ VerifyNotDisposed();
+ if (word == null)
+ {
+ throw new ArgumentNullException("word");
+ }
+ return Bindings.enchant_dict_hyphenate(_handle, word);
+ }
+
public void Add(string word)
{
VerifyNotDisposed();
diff --git a/src/bindings/Enchant.Net/Enchant.Net.csproj b/src/bindings/Enchant.Net/Enchant.Net.csproj
index 4ea0099..bfe57fa 100644
--- a/src/bindings/Enchant.Net/Enchant.Net.csproj
+++ b/src/bindings/Enchant.Net/Enchant.Net.csproj
@@ -1,4 +1,4 @@
-<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="3.5">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
@@ -10,6 +10,11 @@
<RootNamespace>Enchant</RootNamespace>
<AssemblyName>Enchant.Net</AssemblyName>
<RunPostBuildEvent>Always</RunPostBuildEvent>
+ <FileUpgradeFlags>
+ </FileUpgradeFlags>
+ <OldToolsVersion>2.0</OldToolsVersion>
+ <UpgradeBackupLocation>
+ </UpgradeBackupLocation>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>