<?xml version="1.0" encoding="UTF-8"?>
<!-- generator="wordpress/2.2.1" -->
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	>

<channel>
	<title>Palaso</title>
	<link>http://www.wesay.org/blogs/palaso</link>
	<description>Payap Language Software</description>
	<pubDate>Mon, 23 Jun 2008 04:05:44 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.2.1</generator>
	<language>en</language>
			<item>
		<title>Git notes</title>
		<link>http://www.wesay.org/blogs/palaso/2008/06/23/git-notes/</link>
		<comments>http://www.wesay.org/blogs/palaso/2008/06/23/git-notes/#comments</comments>
		<pubDate>Mon, 23 Jun 2008 04:05:44 +0000</pubDate>
		<dc:creator>Eric Albright</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.wesay.org/blogs/palaso/2008/06/23/git-notes/</guid>
		<description><![CDATA[Now that I&#8217;ve used git for a couple weeks, I thought I&#8217;d make a few notes of commands I&#8217;ve found helpful.
To make a local branch for development
git checkout -b name_of_new_branch
To commit changes to the local repository (although I usually use the visual gittk for this)
git commit -a
To commit changes back to subversion
git svn dcommit
To uncommit
git [...]]]></description>
			<content:encoded><![CDATA[<p>Now that I&#8217;ve used git for a couple weeks, I thought I&#8217;d make a few notes of commands I&#8217;ve found helpful.</p>
<p><em>To make a local branch for development</em><br />
<code>git checkout -b name_of_new_branch</code></p>
<p><em>To commit changes to the local repository (although I usually use the visual gittk for this)</em><br />
<code>git commit -a</code></p>
<p><em>To commit changes back to subversion</em><br />
<code>git svn dcommit</code></p>
<p><em>To uncommit</em><br />
<code>git reset HEAD~1</code></p>
<p><em>To keep a local branch up to date with subversion (use git stash to hide away local uncommitted changes for later)</em><br />
<code>git svn rebase</code></p>
<p><em>To move the master branch up to trunk</em><br />
<code>git checkout master</code><br />
<code>git svn rebase</code></p>
<p><em>to handle conflicts with merge</em><br />
<code>git mergetool path_to_file_needing_merge</code><br />
or<br />
<code>git mergetool -t toolname path_to_file_needing_merge</code></p>
<p><em>To remove untracked files (like the temps that get created during a merge resolve)</em><br />
<code>git clean -n</code> to see what it would do<br />
<code>git clean -f -d</code> (-d if you want to remove untracked directories as well)</p>
]]></content:encoded>
			<wfw:commentRss>http://www.wesay.org/blogs/palaso/2008/06/23/git-notes/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Git, Subversion and a CRLF mess</title>
		<link>http://www.wesay.org/blogs/palaso/2008/06/23/git-subversion-and-a-crlf-mess/</link>
		<comments>http://www.wesay.org/blogs/palaso/2008/06/23/git-subversion-and-a-crlf-mess/#comments</comments>
		<pubDate>Mon, 23 Jun 2008 03:57:31 +0000</pubDate>
		<dc:creator>Eric Albright</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.wesay.org/blogs/palaso/2008/06/23/git-subversion-and-a-crlf-mess/</guid>
		<description><![CDATA[When initializing from WeSay&#8217;s Subversion repository, (git svn init -t tags -b branches -T trunk http://www.wesay.org/code/WeSay) I found that I was then told that I had a ton of files that had changed. Turns out on Windows, git has core.autocrlf = true by default &#8212; a good thing. But git-svn apparently doesn&#8217;t take this into [...]]]></description>
			<content:encoded><![CDATA[<p>When initializing from WeSay&#8217;s Subversion repository, (git svn init -t tags -b branches -T trunk http://www.wesay.org/code/WeSay) I found that I was then told that I had a ton of files that had changed. Turns out on Windows, git has core.autocrlf = true by default &#8212; a good thing. But git-svn apparently doesn&#8217;t take this into account and if you have crlf&#8217;s stored in the svn repository, they will be pushed into the git repository as well. So for now we have a repository that has crlf&#8217;s in it instead of just lf&#8217;s which get translated depending on the platform. Setting core.autocrlf to false and then doing a hard reset will make this work for now, although not as nicely as we would like. (git config core.autocrlf=false; git reset &#8211;hard)</p>
]]></content:encoded>
			<wfw:commentRss>http://www.wesay.org/blogs/palaso/2008/06/23/git-subversion-and-a-crlf-mess/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Merging with git</title>
		<link>http://www.wesay.org/blogs/palaso/2008/06/12/merging-with-git/</link>
		<comments>http://www.wesay.org/blogs/palaso/2008/06/12/merging-with-git/#comments</comments>
		<pubDate>Thu, 12 Jun 2008 06:03:41 +0000</pubDate>
		<dc:creator>Eric Albright</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.wesay.org/blogs/palaso/2008/06/12/merging-with-git/</guid>
		<description><![CDATA[Git still doesn&#8217;t have good unicode support so to merge unicode files that git has labeled binary, I wanted to use a visual merger. Finally figured out how to do it &#8212; add the following lines  to config:

[merge]
   tool = tortoise

[mergetool "tortoise"]
   cmd = \"TortoiseMerge.exe\" /base:\"$BASE\" /theirs:\"$REMOTE\" /mine:\"$LOCAL\" /merged:\"$MERGED\"

[mergetool "p4"]
 [...]]]></description>
			<content:encoded><![CDATA[<p>Git still doesn&#8217;t have good unicode support so to merge unicode files that git has labeled binary, I wanted to use a visual merger. Finally figured out how to do it &#8212; add the following lines  to config:</p>
<pre>
[merge]
   tool = tortoise

[mergetool "tortoise"]
   cmd = \"TortoiseMerge.exe\" /base:\"$BASE\" /theirs:\"$REMOTE\" /mine:\"$LOCAL\" /merged:\"$MERGED\"

[mergetool "p4"]
   cmd = \"p4merge.exe\"  \"$BASE\" \"$REMOTE\" \"$LOCAL\" \"$MERGED\"</pre>
<p>If you don&#8217;t have TortoiseMerge.exe in your path then you can replace that with the full path (c:/Program Files/TortoiseSVN/bin/TortoiseMerge.exe).</p>
]]></content:encoded>
			<wfw:commentRss>http://www.wesay.org/blogs/palaso/2008/06/12/merging-with-git/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Upgrading user settings in C#</title>
		<link>http://www.wesay.org/blogs/palaso/2008/06/10/upgrading-user-settings-in-c/</link>
		<comments>http://www.wesay.org/blogs/palaso/2008/06/10/upgrading-user-settings-in-c/#comments</comments>
		<pubDate>Tue, 10 Jun 2008 05:31:57 +0000</pubDate>
		<dc:creator>Tim Armstrong</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.wesay.org/blogs/palaso/2008/06/10/upgrading-user-settings-in-c/</guid>
		<description><![CDATA[In the course of development we found it necessary to migrate an old user setting into a new one and to then remove it. This brought with it a few problems which I hope to shed some light on below.
In order to get the value of the old setting we used the Property.Settings.GetPreviousVersion() method. Initially [...]]]></description>
			<content:encoded><![CDATA[<p>In the course of development we found it necessary to migrate an old user setting into a new one and to then remove it. This brought with it a few problems which I hope to shed some light on below.</p>
<p>In order to get the value of the old setting we used the Property.Settings.GetPreviousVersion() method. Initially we were getting a SettingsPropertyNotFoundException() although the setting was verifiably present in the user.config file. As it turns out we had removed the Property from the Settings designer which removed the Property in the Property.Settings class. In order for Settings to be found, they have to have a property that is tagged with the [UserScopedSettingAttribute] attribute. This tells the GetPreviousVersion() method to look for the setting in user.config. So far so good&#8230;</p>
<p>At this point however, the base.Upgrade() method is called to move old settings into the new file. This causes the old, unwanted setting to be moved in right along with all the old settings that we want to keep around. In order to avoid this behavior the [NoSettingsVersionUpgrade] attribute must also be used for the unwanted Property.</p>
<p>public override void Upgrade()<br />
{<br />
string lastConfigFilePath = (string) GetPreviousVersion(&#8221;LastConfigFilePath&#8221;);<br />
base.Upgrade(); // bring forward our properties that are the<br />
//  same (but also will bring forward LastConfigFilePath)<br />
}</p>
<p>[UserScopedSettingAttribute]<br />
[DebuggerNonUserCode]<br />
[DefaultSettingValueAttribute(&#8221;")]<br />
[Obsolete(&#8221;Please use MruConfigFilePaths instead&#8221;)]<br />
[NoSettingsVersionUpgrade]<br />
public string LastConfigFilePath<br />
{<br />
get<br />
{<br />
throw new NotSupportedException(&#8221;LastConfigFilePath is obsolete&#8221;);<br />
}<br />
set<br />
{<br />
throw new NotSupportedException(&#8221;LastConfigFilePath is obsolete&#8221;);<br />
}<br />
}</p>
]]></content:encoded>
			<wfw:commentRss>http://www.wesay.org/blogs/palaso/2008/06/10/upgrading-user-settings-in-c/feed/</wfw:commentRss>
		</item>
		<item>
		<title>An enchant provider for LIFT</title>
		<link>http://www.wesay.org/blogs/palaso/2008/05/13/an-enchant-provider-for-lift/</link>
		<comments>http://www.wesay.org/blogs/palaso/2008/05/13/an-enchant-provider-for-lift/#comments</comments>
		<pubDate>Tue, 13 May 2008 04:59:35 +0000</pubDate>
		<dc:creator>Eric Albright</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.wesay.org/blogs/palaso/2008/05/13/an-enchant-provider-for-lift/</guid>
		<description><![CDATA[We wanted to allow users to edit their dictionary and use that same dictionary for spell checking. Since WeSay uses  LIFT as the file format for the dictionary and keeps that file up to date, all we needed was an enchant provider that can read LIFT files.
I took the spell checking engine I had [...]]]></description>
			<content:encoded><![CDATA[<p>We wanted to allow users to edit their dictionary and use that same dictionary for spell checking. Since <a href="http://www.wesay.org">WeSay</a> uses  <a href="http://code.google.com/p/lift-standard/">LIFT</a> as the file format for the dictionary and keeps that file up to date, all we needed was an enchant provider that can read LIFT files.</p>
<p>I took the spell checking engine I had written a while back, <a href="http://code.google.com/p/ascens/">Ascens</a>, and refactored it so that it could read files of various formats. Currently it supports line based and <a href="http://en.wikipedia.org/wiki/Xml">XML</a> based formats. For line based formats, the words are entered one per line. For XML based formats, an <a href="http://en.wikipedia.org/wiki/Xpath">XPath</a> expression determines what text from within the file should be selected to constitute correctly spelled words.</p>
<p>Ascens looks for a settings file with the same name as the language identifier that is passed to enchant. Within the settings file, the location of the dictionary and the type of the dictionary are specified. If the type is xml then the xpath expression should be defined.</p>
<p>The following is an example settings file for Ascens referring to a Lift file:</p>
<p><code># This is the settings file for Ascens<br />
[Dictionary]<br />
# Type is either xml or line<br />
# for xml you also need to set the XPath<br />
#Type=line<br />
Type=xml</code></p>
<p><code># path to the dictionary<br />
# (can be absolute or relative to the directory that this file is in)<br />
#Path=c:\documents and settings\user\my documents\dictionaries\fr_FR.dic<br />
#Path=fr_FR.dic<br />
Path=..\..\..\My Documents\WeSay\French\French.lift<br />
</code></p>
<p><code># XPath gives the Xpath that selects the words to be used as dictionary<br />
# it must all be on a single line<br />
XPath=//entry[not(citation-form/form[@lang='fr'])]/lexical-unit/form[@lang='fr']/text | //entry/citation-form/form[@lang='fr']/text<br />
</code><code># this xpath selects the forms with the language id of 'fr' from the<br />
# citation form when there is one and from the lexical unit when<br />
# there is no citation form (it will not select both)</code></p>
<p>Enchant looks for user Ascens settings files in the following locations:</p>
<ol>
<li>The <code>ascens</code> subdirectory of the value found in the registry at  <code>HKEY_CURRENT_USER\Software\Enchant\Config\Data_Dir</code>, if there is one.</li>
<li><code>%APPDATA%\enchant\ascens</code>, where <code>%APPDATA%</code> is shorthand for the <code>C:\Users\&lt;username&gt;\AppData\Roaming\</code> folder (Windows Vista) or the <code>C:\Documents and Settings\&lt;username&gt;\Application Data\</code> folder (Windows XP/2000).</li>
<li>The <code>enchant\ascens</code> subdirectory of the directory value found in the registry at <code>HKEY_CURRENT_USER\Software\Enchant\Config\Home_Dir</code>, if there is one.</li>
<li><code>%USERPROFILE%\enchant\ascens</code>, where <code>%USERPROFILE%</code> is shorthand for the <code>C:\Users\&lt;username&gt;</code> folder (Windows Vista) or the <code>C:\Documents and Settings\&lt;username&gt;</code> folder (Windows XP/2000).</li>
</ol>
<p>Enchant looks for shared Ascens settings files in the following locations:</p>
<ol>
<li>Using the value found in the registry at <code>HKEY_CURRENT_USER\Software\Enchant\ascens\Data_Dir</code>, if there is one. Otherwise, using the value found in the registry at <code>HKEY_LOCAL_MACHINE\Software\Enchant\ascens\Data_Dir</code>, if there is one.</li>
<li><code>&lt;enchant&gt;\share\enchant\ascens</code>, where <code>&lt;enchant&gt;</code> is the location of <code>libenchant.dll.</code></li>
</ol>
]]></content:encoded>
			<wfw:commentRss>http://www.wesay.org/blogs/palaso/2008/05/13/an-enchant-provider-for-lift/feed/</wfw:commentRss>
		</item>
		<item>
		<title>WeSay Tests on Mono Status</title>
		<link>http://www.wesay.org/blogs/palaso/2008/04/22/wesay-tests-on-mono-status/</link>
		<comments>http://www.wesay.org/blogs/palaso/2008/04/22/wesay-tests-on-mono-status/#comments</comments>
		<pubDate>Tue, 22 Apr 2008 04:00:48 +0000</pubDate>
		<dc:creator>Eric Albright</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.wesay.org/blogs/palaso/2008/04/22/wesay-tests-on-mono-status/</guid>
		<description><![CDATA[One step toward getting WeSay to run on the OLPC is to verify that it can run with Mono. We already reported all the System.Windows.Forms bugs that we could find by running MWF on Windows as documented here. The next step has been to run all the tests under Mono. As you can see from [...]]]></description>
			<content:encoded><![CDATA[<p>One step toward getting WeSay to run on the OLPC is to verify that it can run with Mono. <a href="http://www.wesay.org/blogs/palaso/wp-content/uploads/2008/04/wesaytestsonmonostatus.jpg" title="WeSay Tests on Mono"><img src="http://www.wesay.org/blogs/palaso/wp-content/uploads/2008/04/wesaytestsonmonostatus.jpg" title="WeSay Tests on Mono" alt="WeSay Tests on Mono" align="left" /></a>We already reported all the System.Windows.Forms bugs that we could find by running MWF on Windows as documented <a href="http://www.mono-project.com/Guide:_Debugging_With_MWF">here</a>. The next step has been to run all the tests under Mono. As you can see from the diagram (that actually lives on our whiteboard) at left, we have found and fixed and reported quite a few bugs that have made the number of failing tests plummet. We&#8217;re still not there yet, but I&#8217;m making good progress.</p>
<div clear="all"/>
]]></content:encoded>
			<wfw:commentRss>http://www.wesay.org/blogs/palaso/2008/04/22/wesay-tests-on-mono-status/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Formatting dictionaries with CSS</title>
		<link>http://www.wesay.org/blogs/palaso/2008/02/26/formatting-dictionaries-with-css/</link>
		<comments>http://www.wesay.org/blogs/palaso/2008/02/26/formatting-dictionaries-with-css/#comments</comments>
		<pubDate>Tue, 26 Feb 2008 15:25:15 +0000</pubDate>
		<dc:creator>Eric Albright</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.wesay.org/blogs/palaso/2008/02/26/formatting-dictionaries-with-css/</guid>
		<description><![CDATA[In evaluating CSS as a stylesheet language for formatting dictionaries, I started putting PrinceXML through its paces. I tried what I considered to be the hardest dictionary layout and while I think I have matched many of the features. The sidenotes are just not going to happen without specialized support for them in CSS. (The [...]]]></description>
			<content:encoded><![CDATA[<p>In evaluating CSS as a stylesheet language for formatting dictionaries, I started putting <a href="http://www.princexml.com">PrinceXML</a> through its paces. I tried what I considered to be <a href="http://www.antimoon.com/how/cobuild-review-page2.gif"><img src="http://www.antimoon.com/how/cobuild-review-page2.gif" title="Cobuild dictionary" alt="Cobuild dictionary" align="right" width="300" />the hardest dictionary layout</a> and while I think I have matched many of the features. The sidenotes are just not going to happen without specialized support for them in CSS. (The closest I could get was a float but of course if you have more than one within a line, they just write on top of each other). <a href="http://www.wesay.org/blogs/palaso/wp-content/uploads/2008/03/dictionary-layout-cobuild.pdf" title="Dictionary Layout Cobuild Style">That result is here.</a> I then switched to a more typical layout which had no problems at all.  <a href="http://www.wesay.org/blogs/palaso/wp-content/uploads/2008/03/dictionary-layout-macmillan.pdf" title="Dictionary Layout MacMillan Style">That result is here</a>. You can get <a href="http://www.wesay.org/blogs/palaso/wp-content/uploads/2008/03/dictionary-layout.zip" title="All files to reproduce Formatting Dictionaries with CSS exercise">all the files to reproduce this exercise here.</a></p>
<h2>Types of style</h2>
<p>There are really a number items which contribute to the style of a dictionary:</p>
<ol>
<li>Selection of fields</li>
<li>Order of fields</li>
<li>Textual markup - characters or text that is added before, after, or around items to distinguish a field from surrounding text</li>
<li>Character styles - font changes</li>
<li>Paragraph styles</li>
<li>Page layout - columns</li>
</ol>
<p>CSS actually allows us to handle items 1, 3-6. (Selection of fields can be handled by setting the display property to none.) All the textual markup in the examples was done using the CSS content property.</p>
<h2>CSS3 Selectors</h2>
<p>Another interesting behavior of CSS 3 is that you cannot select the first element having a class containing the word &#8216;pronunciation&#8217;:</p>
<p><code>.pronunciation:first-of-type</code></p>
<p>You can only use the <code>:first-of-type</code> selector to select the first element with a particular name so a general <code>div</code> and <code>span</code> with class attributes would have to be converted to xml named elements instead. There is a way around this, given that our document will be generated from another format and that is to actually add classes <code>first-of-type</code> and <code>last-of-type</code>. Then the data becomes:</p>
<p><code>&lt;span class="pronunciation first-of-type"&gt;...&lt;/span&gt;&lt;span class="pronunciation"&gt;...&lt;/span&gt;&lt;span class="pronunciation last-of-type"&gt;...&lt;/span&gt;<br />
</code></p>
<p>and</p>
<p><code>&lt;span class="pronunciation first-of-type last-of-type"&gt;...&lt;/span&gt;</code></p>
<p>Playing with both the xml and xhtml varieties in IE7 and Firefox 2 shows that both do a much better job with the xhtml over xml.</p>
<h2>Column-span</h2>
<p>The only other problem I ran into was that Prince does not yet support the column-span property. This ended up not being a big problem since I just wanted the heading to span both columns and was able to work around this by making the first page of the section have a 12cm top margin and to float the heading into this space.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.wesay.org/blogs/palaso/2008/02/26/formatting-dictionaries-with-css/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Configuring where Enchant looks for files</title>
		<link>http://www.wesay.org/blogs/palaso/2008/02/22/configuring-where-enchant-looks-for-files/</link>
		<comments>http://www.wesay.org/blogs/palaso/2008/02/22/configuring-where-enchant-looks-for-files/#comments</comments>
		<pubDate>Fri, 22 Feb 2008 14:00:40 +0000</pubDate>
		<dc:creator>Eric Albright</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.wesay.org/blogs/palaso/2008/02/22/configuring-where-enchant-looks-for-files/</guid>
		<description><![CDATA[Editorial note (April 25, 2008): With Enchant 1.4.1 the strategy for finding dictionaries has changed.  I have updated this information to reflect this version.
So far, I have covered how to get started using Enchant and how to set up dictionaries. This post will cover more advanced concepts that let an application developer or a [...]]]></description>
			<content:encoded><![CDATA[<p><ins datetime="2008-04-25T02:16:23+00:00"><strong>Editorial note (April 25, 2008):</strong> With Enchant 1.4.1 the strategy for finding dictionaries has changed.  I have updated this information to reflect this version.</ins></p>
<p>So far, I have covered <a href="http://www.wesay.org/blogs/palaso/2008/02/20/using-enchant-in-a-windows-app-getting-started/">how to get started using Enchant</a> and <a href="http://www.wesay.org/blogs/palaso/2008/02/21/setting-up-dictionaries-for-enchant/">how to set up dictionaries</a>. This post will cover more advanced concepts that let an application developer or a user take more control over <a href="http://www.abisource.com/projects/enchant/">Enchant</a>.</p>
<h2>Where Enchant looks for providers</h2>
<p>Enchant looks for which providers are available when the <code>enchant_broker_init</code> function is called.</p>
<p>Providers can be installed on the machine for all users to share or can be installed for only one user. If Enchant finds a particular provider <del datetime="2008-04-25T02:16:23+00:00">as a shared provider and as a user provider, the user provider</del> <ins datetime="2008-04-25T02:43:00+00:00">in more than one place, the first one found</ins> is used.</p>
<p><del datetime="2008-04-25T02:16:23+00:00">Enchant looks for shared providers in the following locations:</del></p>
<ol>
<li><del datetime="2008-04-25T02:43:00+00:00">The directory value found in the registry at <code>HKEY_LOCAL_MACHINE\Software\Enchant\Config\Module_Dir</code>, if there is one.</del></li>
<li><del datetime="2008-04-25T02:16:23+00:00">Otherwise, in <code>&lt;enchant&gt;\lib\enchant</code>, where <code>&lt;enchant&gt;</code> is the location of <code>libenchant.dll.</code></del></li>
</ol>
<p><del datetime="2008-04-25T02:16:23+00:00">The provider location for the user is determined by:</del></p>
<p><ins datetime="2008-04-25T02:43:00+00:00">Enchant loads providers from the following locations:</ins></p>
<ol>
<li>The directory value found in the registry at <code>HKEY_CURRENT_USER\Software\Enchant\Config\Module_Dir</code>, if there is one.</li>
<li><del datetime="2008-04-25T03:06:58+00:00">Otherwise, in </del><code>%APPDATA%\enchant</code>, where <code>%APPDATA%</code> is shorthand for the <code>C:\Users\&lt;username&gt;\AppData\Roaming\</code> folder (Windows Vista) or the <code>C:\Documents and Settings\&lt;username&gt;\Application Data\</code> folder (Windows XP/2000).</li>
<li><ins datetime="2008-04-25T02:43:00+00:00">The <code>enchant</code> subdirectory of the directory value found in the registry at <code>HKEY_CURRENT_USER\Software\Enchant\Config\Home_Dir</code>, if there is one.</ins></li>
<li><ins datetime="2008-04-25T02:35:06+00:00"><code>%USERPROFILE%\enchant</code>, where <code>%USERPROFILE%</code> is shorthand for the <code>C:\Users\&lt;username&gt;</code> folder (Windows Vista) or the <code>C:\Documents and Settings\&lt;username&gt;</code> folder (Windows XP/2000).</ins></li>
<li><ins datetime="2008-04-25T02:43:00+00:00">The directory value found in the registry at <code>HKEY_LOCAL_MACHINE\Software\Enchant\Config\Module_Dir</code>, if there is one.</ins></li>
<li><ins datetime="2008-04-25T02:16:23+00:00"><code>&lt;enchant&gt;\lib\enchant</code>, where <code>&lt;enchant&gt;</code> is the location of <code>libenchant.dll.</code></ins></li>
</ol>
<h2>How Enchant decides which provider to load for a given language</h2>
<p>The provider that is used for a given language is determined by the provider ordering. This can be set programatically by using the <code>enchant_broker_set_ordering</code> function. Enchant initializes the ordering by looking in the <code>enchant.ordering</code> file. <ins datetime="2008-04-25T03:06:58+00:00">Later entries override earlier entries.</ins> <del datetime="2008-04-25T03:06:58+00:00">There is a shared ordering file as well as a user ordering file. A user entry overrides a shared entry.</del></p>
<p><del datetime="2008-04-25T03:06:58+00:00">Enchant looks for the shared <code>enchant.ordering</code> file in the following locations:</del></p>
<ol>
<li><del datetime="2008-04-25T03:06:58+00:00">The value found in the registry at <code></code> <code>HKEY_LOCAL_MACHINE\Software\Enchant\Config\Data_Dir</code>, if any</del></li>
<li><del datetime="2008-04-25T03:06:58+00:00">Otherwise, in <code>&lt;enchant&gt;\share\enchant</code>, where <code>&lt;enchant&gt;</code> is the location of <code>libenchant.dll.</code></del></li>
</ol>
<p>Enchant looks for the <del datetime="2008-04-25T03:06:58+00:00">user</del> enchant.ordering file in the following locations:</p>
<ol>
<li><del datetime="2008-04-25T03:06:58+00:00">Using the value found in the registry at <code>HKEY_CURRENT_USER\Software\Enchant\Config\Data_Dir</code>, if there is one.</del></li>
<li><del datetime="2008-04-25T03:06:58+00:00">Otherwise, in <code>%APPDATA%\enchant</code>, where <code>%APPDATA%</code> is shorthand for the <code>C:\Users\&lt;username&gt;\AppData\Roaming\</code> folder (Windows Vista) or the <code>C:\Documents and Settings\&lt;username&gt;\Application Data\</code> folder (Windows XP/2000).</del></li>
<li><ins datetime="2008-04-25T03:06:58+00:00"><code>&lt;enchant&gt;\share\enchant</code>, where <code>&lt;enchant&gt;</code> is the location of <code>libenchant.dll.</code></ins></li>
<li><ins datetime="2008-04-25T03:06:58+00:00">The value found in the registry at <code>HKEY_LOCAL_MACHINE\Software\Enchant\Config\Data_Dir</code>, if any</ins></li>
</ol>
<p>If enchant doesn&#8217;t find any ordering files and the ordering is not overridden programmatically then the ordering is system dependent (but I think that means they will be ordered alphabetically by filename).</p>
<h2>Where Enchant looks for Ispell dictionaries</h2>
<p>Enchant looks for user Ispell dictionaries in the following locations:</p>
<ol>
<li><del datetime="2008-04-25T03:25:41+00:00">Using</del> <ins datetime="2008-04-25T03:25:41+00:00">The <code>ispell</code> subdirectory of</ins> the value found in the registry at <code>HKEY_CURRENT_USER\Software\Enchant\Config\Data_Dir</code>, if there is one.</li>
<li><del datetime="2008-04-25T03:25:41+00:00">Otherwise, in</del> <code>%APPDATA%\enchant\ispell</code>, where <code>%APPDATA%</code> is shorthand for the <code>C:\Users\&lt;username&gt;\AppData\Roaming\</code> folder (Windows Vista) or the <code>C:\Documents and Settings\&lt;username&gt;\Application Data\</code> folder (Windows XP/2000).</li>
<li><ins datetime="2008-04-25T02:43:00+00:00">The <code>enchant\ispell</code> subdirectory of the directory value found in the registry at <code>HKEY_CURRENT_USER\Software\Enchant\Config\Home_Dir</code>, if there is one.</ins></li>
<li><ins datetime="2008-04-25T02:35:06+00:00"><code>%USERPROFILE%\enchant\ispell</code>, where <code>%USERPROFILE%</code> is shorthand for the <code>C:\Users\&lt;username&gt;</code> folder (Windows Vista) or the <code>C:\Documents and Settings\&lt;username&gt;</code> folder (Windows XP/2000).</ins></li>
</ol>
<p>Enchant looks for shared Ispell dictionaries in the following locations:</p>
<ol>
<li>Using the value found in the registry at <code>HKEY_CURRENT_USER\Software\Enchant\Ispell\Data_Dir</code>, if there is one. <ins datetime="2008-04-25T03:25:41+00:00">Otherwise, using the value found in the registry at <code>HKEY_LOCAL_MACHINE\Software\Enchant\Ispell\Data_Dir</code>, if there is one.</ins></li>
<li><del datetime="2008-04-25T03:25:41+00:00">Otherwise, using the value found in the registry at <code>HKEY_LOCAL_MACHINE\Software\Enchant\Ispell\Data_Dir</code>, if there is one.</del></li>
<li><del datetime="2008-04-25T03:25:41+00:00">Otherwise, in </del><code>&lt;enchant&gt;\share\enchant\ispell</code>, where <code>&lt;enchant&gt;</code> is the location of <code>libenchant.dll.</code></li>
</ol>
<h2>Where Enchant looks for MySpell dictionaries</h2>
<p>Enchant looks for user MySpell dictionaries in the following locations:</p>
<ol>
<li><del datetime="2008-04-25T03:25:41+00:00">Using</del><ins datetime="2008-04-25T03:25:41+00:00">The <code>myspell</code> subdirectory of</ins> the value found in the registry at <code>HKEY_CURRENT_USER\Software\Enchant\Config\Data_Dir</code>, if there is one.</li>
<li><del datetime="2008-04-25T03:25:41+00:00">Otherwise, in </del><code>%APPDATA%\enchant\myspell</code>, where <code>%APPDATA%</code> is shorthand for the <code>C:\Users\&lt;username&gt;\AppData\Roaming\</code> folder (Windows Vista) or the <code>C:\Documents and Settings\&lt;username&gt;\Application Data\</code> folder (Windows XP/2000).</li>
<li><ins datetime="2008-04-25T02:43:00+00:00">The <code>enchant\myspell</code> subdirectory of the directory value found in the registry at <code>HKEY_CURRENT_USER\Software\Enchant\Config\Home_Dir</code>, if there is one.</ins></li>
<li><ins datetime="2008-04-25T02:35:06+00:00"><code>%USERPROFILE%\enchant\myspell</code>, where <code>%USERPROFILE%</code> is shorthand for the <code>C:\Users\&lt;username&gt;</code> folder (Windows Vista) or the <code>C:\Documents and Settings\&lt;username&gt;</code> folder (Windows XP/2000).</ins></li>
</ol>
<p>Enchant looks for shared Myspell dictionaries in the following locations:</p>
<ol>
<li>Using the value found in the registry at <code>HKEY_CURRENT_USER\Software\Enchant\Myspell\Data_Dir</code>, if there is one.<ins datetime="2008-04-25T03:25:41+00:00">Otherwise, using the value found in the registry at <code>HKEY_LOCAL_MACHINE\Software\Enchant\Myspell\Data_Dir</code>, if there is one.</ins></li>
<li><del datetime="2008-04-25T03:25:41+00:00">Otherwise, using the value found in the registry at <code>HKEY_LOCAL_MACHINE\Software\Enchant\Myspell\Data_Dir</code>, if there is one.</del></li>
<li><del datetime="2008-04-25T03:25:41+00:00">Otherwise, in</del> <code>&lt;enchant&gt;\share\enchant\myspell</code>, where <code>&lt;enchant&gt;</code> is the location of <code>libenchant.dll.</code></li>
</ol>
<p>In addition, if OpenOffice (or StarOffice) is installed, Enchant will find the dictionaries that are located in <code>&lt;openoffice&gt;\share\dict\ooo</code>, where <code>&lt;openoffice&gt;</code> is the location where OpenOffice is installed. A user dictionary will be used before a shared dictionary, which in turn will be used before an OpenOffice dictionary.</p>
<h2>Where Enchant looks for the Aspell library</h2>
<p>Enchant looks for the <code>aspell-15.dll</code> using the following locations:</p>
<ol>
<li>Using the value found in the registry at <code>HKEY_CURRENT_USER\Software\Enchant\Aspell\Module</code>, if there is one (this value should include the filename and not just the path).</li>
<li>Otherwise, using the value found in the registry at <code>HKEY_LOCAL_MACHINE\Software\Enchant\Aspell\Module</code>, if there is one (this value should include the filename and not just the path).</li>
<li>Otherwise, using the value found in the registry at <code>HKEY_LOCAL_MACHINE\Software\Aspell\Path</code>, if there is one, as the path to find <code>aspell-15.dll</code> (this is set by the Aspell installer for Windows).</li>
<li>Otherwise, in the same directory as <code>libenchant_aspell.dll.</code></li>
<li>Otherwise, it uses <a href="http://msdn2.microsoft.com/en-us/library/ms682586.aspx">the normal Windows search strategy</a>, which includes looking in the path.</li>
</ol>
]]></content:encoded>
			<wfw:commentRss>http://www.wesay.org/blogs/palaso/2008/02/22/configuring-where-enchant-looks-for-files/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Setting up dictionaries for Enchant</title>
		<link>http://www.wesay.org/blogs/palaso/2008/02/21/setting-up-dictionaries-for-enchant/</link>
		<comments>http://www.wesay.org/blogs/palaso/2008/02/21/setting-up-dictionaries-for-enchant/#comments</comments>
		<pubDate>Thu, 21 Feb 2008 05:33:03 +0000</pubDate>
		<dc:creator>Eric Albright</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.wesay.org/blogs/palaso/2008/02/21/setting-up-dictionaries-for-enchant/</guid>
		<description><![CDATA[In my last post, I gave some tips for getting started with Enchant but you really can&#8217;t get anywhere until you have properly configured the providers and installed some dictionaries.
ASpell
The ASpell provider for Enchant requires aspell-15.dll. The easiest way to get started with ASpell is to use the installer for ASpell and for dictionaries.

Be sure [...]]]></description>
			<content:encoded><![CDATA[<p>In my <a href="http://www.wesay.org/blogs/palaso/2008/02/20/using-enchant-in-a-windows-app-getting-started/">last post</a>, I gave some tips for getting started with <a href="http://www.abisource.com/projects/enchant/">Enchant</a> but you really can&#8217;t get anywhere until you have properly configured the providers and installed some dictionaries.</p>
<h2>ASpell</h2>
<p>The ASpell provider for Enchant requires <code>aspell-15.dll</code>. The easiest way to get started with ASpell is to use the installer for ASpell and for dictionaries.</p>
<ol>
<li>Be sure you have the ASpell provider (you can list it with enchant-lsmod) libenchant_aspell.dll</li>
<li>Download <a href="http://ftp.gnu.org/gnu/aspell/w32/Aspell-0-50-3-3-Setup.exe">the installer</a> and run it to install ASpell.</li>
<li>Download <a href="http://aspell.net/win32/">a dictionary installer from here</a> and run the installer.</li>
<li value="4">Verify that it has been installed correctly by running <code>enchant-lsmod.exe -list-dicts</code>. You should see something like: <code>en_US (aspell)</code> but with the language code for the language you installed instead of <code>en_US</code></li>
<li>You can also test it using <code>enchant -d en_US -a</code> (again using the language code for the language you installed). Then you can type words which are or aren&#8217;t in the dictionary and see suggestions when they aren&#8217;t.</li>
</ol>
<p>It is possible to use ASpell by including the <code>aspell-15.dll</code> in the same directory as <code>libenchant_aspell.dll</code> or it can be somewhere in the path. If you <a href="http://ftp.gnu.org/gnu/aspell/w32/Aspell-0-50-3-3-Setup.exe">install aspell using the Windows installer</a>, it will write a registry entry that points to where it was installed and Enchant will use that to find the dependency.</p>
<h2>MySpell/Hunspell (OpenOffice format)</h2>
<p>Enchant doesn&#8217;t require any additional dependencies other than the MySpell provider for MySpell dictionaries but it does require you to copy the dictionary files to the right place.</p>
<ol>
<li>Be sure you have the MySpell provider (you can list it with enchant-lsmod) libenchant_myspell.dll</li>
<li>Download a dictionary that you want: You can get any of the <a href="http://wiki.services.openoffice.org/wiki/Dictionaries" target="_blank">dictionaries from OpenOffice.org</a>.</li>
<li>Unzip (or otherwise uncompress the package) and copy the contents into <code>%APPDATA%\enchant\myspell</code> (you may need to create the  <code>enchant</code> and <code>myspell</code> directories the first time).<br />
<blockquote><p><code>%APPDATA%</code> is shorthand for the <code>C:\Users\&lt;username&gt;\AppData\Roaming\</code> folder (Windows Vista) or the <code>C:\Documents and Settings\&lt;username&gt;\Application Data\</code> folder (Windows XP/2000). But you can type <code>%APPDATA%</code> in the explorer&#8217;s address bar and it will go to the right place.</p></blockquote>
</li>
<li>Verify that it has been installed correctly by running <code>enchant-lsmod.exe -list-dicts</code>. You should see something like: <code>en_US (myspell)</code> but with the language code for the language you installed instead of <code>en_US</code></li>
<li>You can also test it using <code>enchant -d en_US -a</code> (again using the language code for the language you installed). Then you can type words which are or aren&#8217;t in the dictionary and see suggestions when they aren&#8217;t.</li>
</ol>
<p><strong>Note:</strong> if you install MySpell and ASpell dictionaries for the same language, the ASpell dictionaries will be used instead of the MySpell dictionaries (this can be changed but I&#8217;ll leave that for another post)</p>
<p>If you are feeling really adventurous and would like to create your own, you can <a href="http://lingucomponent.openoffice.org/dictionary.html" target="_blank">see the directions here</a>.</p>
<h2>ISpell</h2>
<p>Enchant&#8217;s Ispell provider also doesn&#8217;t have any dependencies (the dictionaries are read directly by Enchant).</p>
<ol>
<li>Be sure you have the ISpell provider (you can list it with enchant-lsmod) libenchant_ispell.dll</li>
<li>Download a <a href="http://www.abisource.com/~fjf" target="_blank">dictionary from here (at the bottom of the page)</a>.</li>
<li value="3">Unzip (or otherwise uncompress the package) and copy the contents into <code>%APPDATA%\enchant\ispell</code> (you may need to create the  <code>enchant</code> and <code>ispell</code> directories the first time).</li>
<li>Verify that it has been installed correctly by running <code>enchant-lsmod.exe -list-dicts</code>. You should see something like: <code>en_US (ispell)</code> but with the language code for the language you installed instead of <code>en_US</code></li>
<li>You can also test it using <code>enchant -d en_US -a</code> (again using the language code for the language you installed). Then you can type words which are or aren&#8217;t in the dictionary and see suggestions when they aren&#8217;t.</li>
</ol>
<h2>Empty dictionaries</h2>
<p>An easy way to get spell checking for a language that doesn&#8217;t have a dictionary, is to create an empty MySpell dictionary. First, decide on the language code to be used. (You should use <a href="http://en.wikipedia.org/wiki/ISO_639" target="_blank">the iso639 code</a> or the <a href="http://en.wikipedia.org/wiki/IETF_language_tag" target="_blank">ietf language tag</a>, for our example we will use <code>qaa</code>, the first of the private use language codes, as the language code). There are two files that are required, the affix file, <code>qaa.aff</code>, and the dictionary file, <code>qaa.dic</code>. They should both be put in  <code>%APPDATA%\enchant\myspell</code>.</p>
<p>The <code>qaa.aff</code> file should contain the following line:</p>
<blockquote><p>SET UTF-8</p></blockquote>
<p>The <code>qaa.dic</code> file should contain the following line (it&#8217;s a zero, the number of items in the dictionary):</p>
<blockquote><p>0</p></blockquote>
<p>Of course, you won&#8217;t have any items in your empty dictionary so all the words will be marked as misspelled. As you add items to the dictionary using Enchant, the words will be stored in <code>%APPDATA%\enchant\qaa.dic</code>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.wesay.org/blogs/palaso/2008/02/21/setting-up-dictionaries-for-enchant/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Using Enchant in a Windows App: Getting Started</title>
		<link>http://www.wesay.org/blogs/palaso/2008/02/20/using-enchant-in-a-windows-app-getting-started/</link>
		<comments>http://www.wesay.org/blogs/palaso/2008/02/20/using-enchant-in-a-windows-app-getting-started/#comments</comments>
		<pubDate>Wed, 20 Feb 2008 10:00:44 +0000</pubDate>
		<dc:creator>Eric Albright</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.wesay.org/blogs/palaso/2008/02/20/using-enchant-in-a-windows-app-getting-started/</guid>
		<description><![CDATA[The following are notes toward getting started with incorporating Enchant into a Windows application.
Enchant is a spell-checking framework that allows you to use many different spell-checking backends, including Aspell, Hunspell/MySpell, and Ispell.
You can get the source here. Building using MSVC is not difficult once all the dependencies are provided. The full build notes are here.
If [...]]]></description>
			<content:encoded><![CDATA[<p>The following are notes toward getting started with incorporating Enchant into a Windows application.</p>
<p><a href="http://www.abisource.com/projects/enchant/" target="_blank">Enchant</a> is a spell-checking framework that allows you to use many different spell-checking backends, including Aspell, Hunspell/MySpell, and Ispell.</p>
<p>You can get <a href="http://svn.abisource.com/enchant/trunk/" target="_blank">the source here</a>. Building using MSVC is not difficult once <a href="http://spellcore.googlecode.com/svn/trunk/enchant/">all the dependencies are provided</a>. The <a href="http://svn.abisource.com/enchant/trunk/msvc/Build.win32.readme" target="_blank">full build notes are here</a>.</p>
<p>If you don&#8217;t want to bother with building it yourself, you can <a href="http://spellcore.googlecode.com/svn/trunk/enchant/bin" target="_blank">get the binaries here</a>.</p>
<p>The main library is <code>libenchant.dll</code>. Enchant uses providers (<code>libenchant_aspell.dll</code>, <code>libenchant_ispell.dll</code>, and <code>libenchant_myspell.dll</code>), which are adapters for the various backends. (There are others available but if you want others, you will have to build them yourself.) There is also a .Net binding available (<code>Enchant.Net.dll</code>) that uses <code>libenchant.dll</code>. The Aspell provider only works if you have ASpell installed, while the Hunspell/Myspell provider and the Ispell provider read dictionaries (in the proper format) directly.</p>
<p>By default, Enchant expects to find the providers (the backend adapters) in the subdirectory <code>lib\enchant</code> underneath the location of <code>libenchant.dll</code>.</p>
<p>You can check your setup by running <code>enchant-lsmod.exe</code>. It will list the providers it finds. Run <code>enchant-lsmod.exe -list-dicts</code> to list the available dictionaries.</p>
<p>Next time, I&#8217;ll add more about setting up Enchant to use the dictionaries.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.wesay.org/blogs/palaso/2008/02/20/using-enchant-in-a-windows-app-getting-started/feed/</wfw:commentRss>
		</item>
	</channel>
</rss>
