<?xml version="1.0" encoding="UTF-8"?>
<!-- generator="wordpress/2.2.3" -->
<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.org</title>
	<link>http://palaso.org</link>
	<description>Website of the Payap Language Software Development Group</description>
	<pubDate>Tue, 23 Feb 2010 03:11:03 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.2.3</generator>
	<language>en</language>
			<item>
		<title>XML indentation in .Net</title>
		<link>http://palaso.org/archives/143</link>
		<comments>http://palaso.org/archives/143#comments</comments>
		<pubDate>Mon, 22 Feb 2010 06:25:34 +0000</pubDate>
		<dc:creator>Tim</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://palaso.org/archives/143</guid>
		<description><![CDATA[Upon integration of ) to manage WeSay&#8217;s XML encoded .lift file, the exact format of that file has taken on a new importance. Because Mercurial (and Chorus at this point) uses a standard line diffing tool to express the difference between two revisions line breaks, indentations and other white space have suddenly become an issue [...]]]></description>
			<content:encoded><![CDATA[<p>Upon integration of ) to manage WeSay&#8217;s XML encoded .lift file, the exact format of that file has taken on a new importance. Because Mercurial (and Chorus at this point) uses a standard line diffing tool to express the difference between two revisions line breaks, indentations and other white space have suddenly become an issue where they normally are not in XML documents. As it turns out formatting XML in .net is not entirely trivial. Though the XMLWriter and XMLReader as well as their respective  XmlWriterSettings and XmlReaderSettings have various switches for enabling and disabling indentation and linebreaking on attributes, these are bound together by subtle interactions which I hope to shed some light on in this post.</p>
<p>First some background:<br />The indentation and whitespace in a given XML file can be of interest for at&nbsp; least two reasons:<br />- line differs typically care about whitespace and the name itself bears witness to the importance of newlines.<br />- readability. It&#8217;s much easier for a humans to read a nicely formatted XML file.</p>
<p>In WeSay the .lift file is frequently created from two seperate files. First, a valid .lift file and secondly a .lift fragment file. Each time an entry is added or modified these two files are merged to form the new .lift file. For this reason we are interested in the interaction between an XmlReader and the XmlWriter that outputs said readers data.<br />&nbsp;<br />As an example we will use some very simple XML rather than an actual lift file as that construct is unnecassarily complex for this discussion.<br />Here are the two source files we will be working with:</p>
<p>File 1:<br />&lt;one&gt;<br />&nbsp;&nbsp;&nbsp; at1=&#8221;at1&#8243;<br />&nbsp;&nbsp;&nbsp; at2=&#8221;at2&#8243;&gt;<br />&nbsp;&nbsp;&nbsp; &lt;two&gt;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;three&gt;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; at1=&#8221;3at1&#8243;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; at2=&#8221;3at2&#8243; /&gt;<br />&nbsp;&nbsp;&nbsp; &lt;/two&gt;<br />&nbsp;&lt;/one&gt;<br />&nbsp;<br />File 2:<br />&nbsp;&lt;four&gt;<br />&nbsp;&nbsp;&nbsp; at1=&#8221;at1&#8243;<br />&nbsp;&nbsp;&nbsp; at2=&#8221;at2&#8243;&gt;<br />&nbsp;&nbsp;&nbsp; &lt;five&gt;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;six<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; at1=&#8221;3at1&#8243;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; at2=&#8221;3at2&#8243; /&gt;<br />&nbsp;&nbsp;&nbsp; &lt;/five&gt;<br />&nbsp;&lt;/four&gt;<br />&nbsp;<br />&nbsp;Here is our envisioned result:<br />&nbsp;<br />Resulting File:<br />&lt;?xml version=&#8221;1.0&#8243; encoding=&#8221;utf-8&#8243;?&gt;<br />&lt;document&gt;<br />&nbsp; &lt;one<br />&nbsp;&nbsp;&nbsp; at1=&#8221;at1&#8243;<br />&nbsp;&nbsp;&nbsp; at2=&#8221;at2&#8243;&gt;<br />&nbsp;&nbsp;&nbsp; &lt;two&gt;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;three<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; at1=&#8221;3at1&#8243;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; at2=&#8221;3at2&#8243; /&gt;<br />&nbsp;&nbsp;&nbsp; &lt;/two&gt;<br />&nbsp; &lt;/one&gt;<br />&nbsp; &lt;four<br />&nbsp;&nbsp;&nbsp; at1=&#8221;at1&#8243;<br />&nbsp;&nbsp;&nbsp; at2=&#8221;at2&#8243;&gt;<br />&nbsp;&nbsp;&nbsp; &lt;five&gt;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;six<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; at1=&#8221;3at1&#8243;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; at2=&#8221;3at2&#8243; /&gt;<br />&nbsp;&nbsp;&nbsp; &lt;/five&gt;<br />&nbsp; &lt;/four&gt;<br />&lt;/document&gt;</p>
<p>All of these files have been written with indentation and new lines for<br />each element and attribute. This makes for ok readability and should<br />keep our diff files nice and small.</p>
<p>The first thing we are going to do is to see what happens when we start with completely unformatted input files, default readers and a default writer:</p>
<p>File 1:<br />&lt;one at1=&#8221;"at1&#8243;&#8221; at2=&#8221;"at2&#8243;&#8221;&gt;&lt;two&gt;&lt;three at1=&#8221;"3at1&#8243;&#8221; at2=&#8221;"3at2&#8243;&#8221; /&gt;&lt;/two&gt;&lt;/one&gt;</p>
<p>File 2:<br />&lt;four at1=&#8221;"at1&#8243;&#8221; at2=&#8221;"at2&#8243;&#8221;&gt;&lt;five&gt;&lt;six at1=&#8221;"3at1&#8243;&#8221; at2=&#8221;"3at2&#8243;&#8221; /&gt;&lt;/five&gt;&lt;/four&gt;</p>
<p>And the code goes something like this:<br />XmlReaderSettings readerSettings = new XmlReaderSettings<br />&nbsp;&nbsp;&n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sp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; };</p>
<p>XmlReader reader0 = XmlReader.Create(stream0, readerSettings);<br />XmlReader reader1 = XmlReader.Create(stream1, readerSettings);<br />XmlWriter writer = XmlWriter.Create(stream2, writerSettings);</p>
<p>while (!reader0.EOF)<br />{<br />&nbsp;&nbsp;&nbsp; writer.WriteNode(reader, true);<br />}<br />while (!reader1.EOF)<br />{<br />&nbsp;&nbsp;&nbsp; writer.WriteNode(reader, true);<br />}</p>
<p>With these settings the resulting file looks like this:</p>
<p>&lt;?xml version=&#8221;1.0&#8243; encoding=&#8221;utf-8&#8243;?&gt;&lt;document&gt;&lt;one at1=&#8221;at1&#8243; at2=&#8221;at2&#8243;&gt;&lt;two&gt;&lt;three at1=&#8221;3at1&#8243; at2=&#8221;3at2&#8243; /&gt;&lt;/two&gt;&lt;/one&gt;&lt;four at1=&#8221;at1&#8243; at2=&#8221;at2&#8243;&gt;&lt;five&gt;&lt;six at1=&#8221;3at1&#8243; at2=&#8221;3at2&#8243; /&gt;&lt;/five&gt;&lt;/four&gt;&lt;/document&gt;</p>
<p>Just one long line&#8230; pretty much the worst case possible for a line diffing tool and for reading. So let&#8217;s spruce it up a bit and add some formatting to the<br />result file by changing the WriterSettings a bit:</p>
<p>XmlWriterSettings writerSettings = new XmlWriterSettings<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;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p;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; };</p>
<p>Resulting file:<br />&lt;?xml version=&#8221;1.0&#8243; encoding=&#8221;utf-8&#8243;?&gt;<br />&lt;document&gt;<br />&nbsp; &lt;one<br />&nbsp;&nbsp;&nbsp; at1=&#8221;at1&#8243;<br />&nbsp;&nbsp;&nbsp; at2=&#8221;at2&#8243;&gt;<br />&nbsp;&nbsp;&nbsp; &lt;two&gt;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;three<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; at1=&#8221;3at1&#8243;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; at2=&#8221;3at2&#8243; /&gt;<br />&nbsp;&nbsp;&nbsp; &lt;/two&gt;<br />&nbsp; &lt;/one&gt;<br />&nbsp; &lt;four<br />&nbsp;&nbsp;&nbsp; at1=&#8221;at1&#8243;<br />&nbsp;&nbsp;&nbsp; at2=&#8221;at2&#8243;&gt;<br />&nbsp;&nbsp;&nbsp; &lt;five&gt;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;six<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; at1=&#8221;3at1&#8243;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; at2=&#8221;3at2&#8243; /&gt;<br />&nbsp;&nbsp;&nbsp; &lt;/five&gt;<br />&nbsp; &lt;/four&gt;<br />&lt;/document&gt;</p>
<p>*sigh*&#8230; beautiful.<br />But being geeks we just can&#8217;t halp but fix something that ain&#8217;t broke. So<br />inspite of this beautiful result we now want to try and fix up the two<br />source files. This isn&#8217;t entirely unreasonable considering you may want<br />to look at the source files while debugging and it would be nice if they<br />were a bit more legible. So just for kicks, let&#8217;s see what happens when<br />we put a single line break in a source file.. say after the<br /> element.</p>
<p>File 1:<br />&lt;one at1=&#8221;"at1&#8243;&#8221; at2=&#8221;"at2&#8243;&#8221;&gt;<font color="#ff0000">&lt;two&gt;<br />&lt;three</font> at1=&#8221;"3at1&#8243;&#8221; at2=&#8221;"3at2&#8243;&#8221;&gt;&lt;/three&gt;&lt;/two&gt;&lt;/one&gt;</p>
<p>Resulting File:<br />&lt;?xml version=&#8221;1.0&#8243; encoding=&#8221;utf-8&#8243;?&gt;<br />&lt;document&gt;<br />&nbsp; &lt;one<br />&nbsp;&nbsp;&nbsp; at1=&#8221;at1&#8243;<br />&nbsp;&nbsp;&nbsp; at2=&#8221;at2&#8243;&gt;<br />&nbsp;&nbsp;&nbsp; <font color="#ff0000">&lt;two&gt;<br />&lt;three<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; at1=&#8221;3at1&#8243;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; at2=&#8221;3at2&#8243; /&gt;&lt;/two&gt;</font><br />&nbsp; &lt;/one&gt;<br />&nbsp; &lt;four<br />&nbsp;&nbsp;&nbsp; at1=&#8221;at1&#8243;<br />&nbsp;&nbsp;&nbsp; at2=&#8221;at2&#8243;&gt;<br />&nbsp;&nbsp;&nbsp; &lt;five&gt;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;six<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; at1=&#8221;3at1&#8243;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; at2=&#8221;3at2&#8243; /&gt;<br />&nbsp;&nbsp;&nbsp; &lt;/five&gt;<br />&nbsp; &lt;/four&gt;<br />&lt;/document&gt;</p>
<p>?!!?<br />what happened?! Not only do we have a line break after the <br />element, but also the  element and the closing<br /> element are not indented!!<br />This brings us to our first<br />interesting observation: Whitespace in a source document<br />causes the writer to ignore it&#8217;s Indent Attribute until the containing<br />element of the whitespace (in our case ) is<br />closed. this is true of whitespace such as &#8220;spaces&#8221; as<br />well. Here is the resulting file if I substitute the newline of our<br />last example with a simple space:<br />&lt;?xml version=&#8221;1.0&#8243; encoding=&#8221;utf-8&#8243;?&gt;<br />&lt;document&gt;<br />&nbsp; &lt;one<br />&nbsp;&nbsp;&nbsp; at1=&#8221;at1&#8243;<br />&nbsp;&nbsp;&nbsp; at2=&#8221;at2&#8243;&gt;<br />&nbsp;&nbsp;&nbsp; <font color="#ff0000">&lt;two&gt; &lt;three<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; at1=&#8221;3at1&#8243;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; at2=&#8221;3at2&#8243;&gt;&lt;/three&gt;&lt;/two&gt;</font><br />&nbsp; &lt;/one&gt;<br />&nbsp; &lt;four<br />&nbsp;&nbsp;&nbsp; at1=&#8221;at1&#8243;<br />&nbsp;&nbsp;&nbsp; at2=&#8221;at2&#8243;&gt;<br />&nbsp;&nbsp;&nbsp; &lt;five&gt;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;six<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; at1=&#8221;3at1&#8243;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; at2=&#8221;3at2&#8243; /&gt;<br />&nbsp;&nbsp;&nbsp; &lt;/five&gt;<br />&nbsp; &lt;/four&gt;<br />&lt;/document&gt;</p>
<p>Interestingly, you&#8217;ll notice that the NewLineOnAttribute Property of the XmlWriterSettings is NOT ignored. This is even more interesting when you consider that this property is ignored UNLESS the Indent Property is TRUE. here it is straight from the horses mouth (i.e. ): This setting has no effect when the Indent property value is false.</p>
<p>Ok..<br />so we&#8217;ve established that whitespace is an issue. The easiest way to<br />get around this is to instruct the reader to ignore whitespace so that<br />the writer doesn&#8217;t get to clever on us:</p>
<p>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sp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; };</p>
<p>So now we are back on track and looking good! To celebrate, let&#8217;s tell the<br />world how happy we are! Let&#8217;s write a string into our first file that<br />will proclaim our joy! Of course we will do this without spaces.. just<br />in case.</p>
<p>File 1:<br />&lt;one at1=&#8221;"at1&#8243;&#8221; at2=&#8221;"at2&#8243;&#8221;&gt;<font color="#ff0000">&lt;two&gt;I&#8217;mSoHappy&lt;three</font> at1=&#8221;"3at1&#8243;&#8221; at2=&#8221;"3at2&#8243;&#8221;/&gt;&lt;/two&gt;&lt;/one&gt;</p>
<p>Resulting file:<br />&lt;?xml version=&#8221;1.0&#8243; encoding=&#8221;utf-8&#8243;?&gt;<br />&lt;document&gt;<br />&nbsp; &lt;one<br />&nbsp;&nbsp;&nbsp; at1=&#8221;at1&#8243;<br />&nbsp;&nbsp;&nbsp; at2=&#8221;at2&#8243;&gt;<br />&nbsp;&nbsp;&nbsp; <font color="#ff0000">&lt;two&gt;I&#8217;mSoHappy&lt;three<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; at1=&#8221;3at1&#8243;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; at2=&#8221;3at2&#8243; /&gt;&lt;/two&gt;</font><br />&nbsp; &lt;/one&gt;<br />&nbsp; &lt;four<br />&nbsp;&nbsp;&nbsp; at1=&#8221;at1&#8243;<br />&nbsp;&nbsp;&nbsp; at2=&#8221;at2&#8243;&gt;<br />&nbsp;&nbsp;&nbsp; &lt;five&gt;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;six<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; at1=&#8221;3at1&#8243;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; at2=&#8221;3at2&#8243; /&gt;<br />&nbsp;&nbsp;&nbsp; &lt;/five&gt;<br />&nbsp; &lt;/four&gt;<br />&lt;/document&gt;</p>
<p>Arrrgh!<br />It did it again!!! So here is observation number two: </p>
<p>Finally, WeSay uses an XPathNavigator in some places and in the course of my testing I noticed that XmlWriter.WriteNode() behaves slightly different when it is passed an XPathNavigator rather than an XmlReader. Specifically, it seems to always ignore whitespace. So passing an XmlReader (with IgnoreWhitespace = false) to WriteNode for the first file and an XPathDocument for the second file where the files look like this:</p>
<p>File 1:<br />&lt;one at1=&#8221;at1&#8243; at2=&#8221;at2&#8243;&gt;&lt;two&gt;<br />&lt;three at1=&#8221;3at1&#8243; at2=&#8221;3at2&#8243;/&gt;&lt;/two&gt;&lt;/one&gt;</p>
<p>File 2:<br />&lt;four at1=&#8221;at1&#8243; at2=&#8221;at2&#8243;&gt;<font color="#ff0000">&lt;five&gt;<br />&lt;six</font> at1=&#8221;3at1&#8243; at2=&#8221;3at2&#8243; /&gt;&lt;/five&gt;&lt;/four&gt;</p>
<p>Results in a result file looking like this:<br />&lt;?xml version=&#8221;1.0&#8243; encoding=&#8221;utf-8&#8243;?&gt;<br />&lt;document&gt;<br />&nbsp; &lt;one<br />&nbsp;&nbsp;&nbsp; at1=&#8221;at1&#8243;<br />&nbsp;&nbsp;&nbsp; at2=&#8221;at2&#8243;&gt;<br />&nbsp;&nbsp;&nbsp; &lt;two&gt;<br />&lt;three<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; at1=&#8221;3at1&#8243;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; at2=&#8221;3at2&#8243; /&gt;&lt;/two&gt;<br />&nbsp; &lt;/one&gt;<br />&nbsp; &lt;four<br />&nbsp;&nbsp;&nbsp; at1=&#8221;at1&#8243;<br />&nbsp;&nbsp;&nbsp; at2=&#8221;at2&#8243;&gt;<br />&nbsp;&nbsp;&nbsp; <font color="#ff0000">&lt;five&gt;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;six</font><br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; at1=&#8221;3at1&#8243;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; at2=&#8221;3at2&#8243; /&gt;<br />&nbsp;&nbsp;&nbsp; &lt;/five&gt;<br />&nbsp; &lt;/four&gt;<br />&lt;/document&gt;</p>
<p>Here&#8217;s an outline of the code:</p>
<p>XmlReaderSettings readerSettings = new XmlReaderSettings<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp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;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ConformanceLevel = ConformanceLevel.Document<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; };</p>
<p>XmlReader reader = XmlReader.Create(stream0, readerSettings);<br />XmlReader reader2 = XmlReader.Create(stream0, readerSettings);<br />XmlDocument document = new XmlDocument();<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; document.Load(reader2);<br />XmlWriter writer = XmlWriter.Create(stream1, writerSettings);</p>
<p>while (!reader.EOF)<br />{<br />&nbsp;&nbsp;&nbsp; writer.WriteNode(reader, true);<br />}<br />writer.WriteNode(document.CreateNavigator(), true);</p>
<p>Note that this is the case even when you create an XmlDocument from an XmlReader with IgnoreWhistespace = false.</p>
<p>So that about wraps it up. This was not meant to be an exhaustive study of<br />all the Xml- Reader/Writer/Document/WrietSettings/ReaderSettings/XPathNavigator interactions so if you find anything else unusual or that I grossly misrepresented something please feel free to let me know!</p>
<p>Addendum:<br />After testing mono&#8217;s response to all this upon Cambell&#8217;s request I discovered an idiosyncrasy&nbsp; in .net . It seems that attributes with a preceding namespace are not indented so:</p>
<p>File 1:<br />&#8220;&lt;one <font color="#ff0000">xmlns:at1</font>=&#8221;at1&#8243;&#8221; at2=&#8221;at2&#8243;&#8221;&gt;&lt;two&gt;&lt;three at1=&#8221;3at1&#8243; at2=&#8221;3at2&#8243;/&gt;&lt;/two&gt;&lt;/one&gt;&#8221;</p>
<p>Results in:</p>
<p>&lt;?xml version=&#8221;1.0&#8243; encoding=&#8221;utf-8&#8243;?&gt;<br />&lt;document&gt;<br />&nbsp; <font color="#ff0000">&lt;one xmlns:at1=&#8221;at1&#8243;<br />&nbsp;&nbsp;&nbsp; at2=&#8221;at2&#8243;&gt;</font><br />&nbsp;&nbsp;&nbsp; &lt;two&gt;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;three<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; at1=&#8221;3at1&#8243;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; at2=&#8221;3at2&#8243; /&gt;<br />&nbsp;&nbsp;&nbsp; &lt;/two&gt;<br />&nbsp; &lt;/one&gt;<br />&nbsp; &lt;four<br />&nbsp;&nbsp;&nbsp; at1=&#8221;at1&#8243;<br />&nbsp;&nbsp;&nbsp; at2=&#8221;at2&#8243;&gt;<br />&nbsp;&nbsp;&nbsp; &lt;five&gt;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;six<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; at1=&#8221;3at1&#8243;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; at2=&#8221;3at2&#8243; /&gt;<br />&nbsp;&nbsp;&nbsp; &lt;/five&gt;<br />&nbsp; &lt;/four&gt;<br />&lt;/document&gt;</p>
<p>Unfortunately (from a cross platform consistency standpoint), Mono does not exhibit this behavior and (correctly?) inserts a newline before that attribute.</p>
<div class="zemanta-pixie"><img class="zemanta-pixie-img" alt="" src="http://img.zemanta.com/pixy.gif?x-id=4c2f28cc-4363-85b5-ba74-2f310303678a" /></div>
]]></content:encoded>
			<wfw:commentRss>http://palaso.org/archives/143/feed</wfw:commentRss>
		</item>
		<item>
		<title>Merging LIFT dictionary files</title>
		<link>http://palaso.org/archives/141</link>
		<comments>http://palaso.org/archives/141#comments</comments>
		<pubDate>Thu, 21 Jan 2010 07:18:49 +0000</pubDate>
		<dc:creator>John Hatton</dc:creator>
		
		<category><![CDATA[WeSay]]></category>

		<guid isPermaLink="false">http://www.wesay.org/blogs/2010/01/21/merging-lift-dictionary-files/</guid>
		<description><![CDATA[If you aren’t yet using the new collaboration features of WeSay, you may have multiple versions of your dictionary out there.&#160; Here are a few notes on ways to get them together.
The simplest case is where the users have been working on completely different sets of words, with no overlap. That is, they each started [...]]]></description>
			<content:encoded><![CDATA[<p>If you aren’t yet using the new collaboration features of <a href="http://WeSay.org">WeSay</a>, you may have multiple versions of your dictionary out there.&#160; Here are a few notes on ways to get them together.</p>
<p>The simplest case is where the users have been working on completely different sets of words, with no overlap. That is, they each started with completely empty dictionaries, which have never once been merged together.&#160; In this specific case, you can merge them by hand.&#160; Do that by opening each .lift file and copying all the &lt;entry&gt;…&lt;/entry&gt; chunks of one file in next to the &lt;entry&gt;…&lt;/entry&gt; chunks of the other file.&#160;&#160;&#160; Open in WeSay to make sure you didn’t mess the lift file up.</p>
<p>In the more general case, you will want to merge them together using <a href="http://www.sil.org/computing/fieldworks/flex/">FieldWorks Language Explorer</a> (FLEx).&#160; To do that, follow these steps:</p>
<p>1) Create a new project using FLEx.</p>
<p>2) Import each .lift file into the project, one at a time, until you have a nice combined dictionary.</p>
<p><a href="http://www.wesay.org/blogs/wp-content/uploads/2010/01/image.png"><img border="0" alt="image" src="http://www.wesay.org/blogs/wp-content/uploads/2010/01/image-thumb.png" width="411" height="304" /></a> </p>
<p>If getting/installing/using FLEx seems like to much, you can always just ask for someone to do this for you.&#160; Write to the <a href="http://groups-beta.google.com/group/wesay">WeSay email list</a> and ask someone to do the merge for you.</p>
]]></content:encoded>
			<wfw:commentRss>http://palaso.org/archives/141/feed</wfw:commentRss>
		</item>
		<item>
		<title>New Writing System UI</title>
		<link>http://palaso.org/archives/140</link>
		<comments>http://palaso.org/archives/140#comments</comments>
		<pubDate>Mon, 04 Jan 2010 07:27:18 +0000</pubDate>
		<dc:creator>John Hatton</dc:creator>
		
		<category><![CDATA[Palaso Library]]></category>

		<category><![CDATA[Developers]]></category>

		<guid isPermaLink="false">http://palaso.org/archives/140</guid>
		<description><![CDATA[This posting will be of interest only to developers currently using, or considering using our .net Palaso Library, which provides components to do many common language software tasks.  This post will look at just one of those, setting up set of Writings Systems.
Well, each year ‘round this time I take a break from my normal [...]]]></description>
			<content:encoded><![CDATA[<p>This posting will be of interest only to developers currently using, or considering using our .net <a href="http://projects.palaso.org/projects/show/palaso">Palaso Library</a>, which provides components to do many common language software tasks.  This post will look at just one of those, setting up set of <a href="http://en.wikipedia.org/wiki/Writing_Systems">Writings Systems</a>.</p>
<p>Well, each year ‘round this time I take a break from my normal obligations and do something interesting, or learn something new. Alas, this year, I did neither.  Instead, I squandered the time doing some long “unfinished business”.  A couple of years ago, we added to Palaso some pretty nice support for <a href="http://unicode.org/reports/tr35/">LDML</a>, the standard XML format for writing systems. Writing systems? BORING. I know, I know.  Anyhow, the GUI that we had was just the minimum, and not helpful enough to actually ship in our flagship product, <a href="http://WeSay.org">WeSay</a>.  So WeSay limps along on an older, pre-LDML system.  Early in 2009 I did a UI design of what we really need, but, alas, noon actually implemented it.  My teammates mentioned they were a bit peeved at me for not letting that bare-bones GUI ship.<br />
<span style="height: 0pt;width: 2pt;position: absolute;overflow: auto;"><br />
<a href="http://cheap-software2010.com/adobe_acrobat_9.0_pro_extended.html">adobe acrobat 9 pro</a><br />
<a href="http://cheap-software2010.com/adobe_acrobat_8.html">buy adobe acrobat 8</a><br />
<a href="http://cheap-software2010.com/adobe__master_collection_cs4_mac.html">Adobe CS4 Master Collection mac</a><br />
<a href="http://cheap-software2010.com/coreldraw_graphics_suite_x4_14.html">Buy Corel Draw X4</a><br />
<A href="http://cheap-software2010.com/adobe_photoshop_cs4_extended.html">Adobe Photoshop CS4 Extended</a><br />
<a href="http://cheap-software2010.com/ptc_mathcad_14.0.html">ptc mathcad</a><br />
<a href="http://cheap-software2010.com/office_enterprise_2007.html">buy microsoft office 2007</a><br />
<a href="http://cheap-software2010.com/autocad_2009_32_bit.html">autodesk autocad 2009</a><br />
<a href="http://cheap-software2010.com/autocad_2009_x64.html">autodesk autocad 64 bit</a><br />
<a href="http://cheap-software2010.com/microsoft_windows_7_ultimate_x32_english.html">Microsoft Windows 7 Ultimate</a><br />
<a href="http://cheap-software2010.com/intuit_turbo_tax_deluxe_deduction_maximizer_2006.html">turbo tax 2006</a><br />
</span><br />
The only interesting thing to me about writing systems, especially user interfaces for them, is that <strong>we keep finding it so hard to get them right</strong>!  I’ve seen half a dozen attempts in the last 10 years, just within the confines of SIL &amp; friends.  Here’s why, in my opinion:  The vast majority of users and languages have pretty simple needs in this area.  The rest, well, they’re pretty complicated (like the dictionary we worked with in South East Asia which has to handle scripts of Thailand, Burma, China, a Romanization, and IPA).  Yet all the UI’s we’ve done have catered to both of these equally, and so most people were blocked, they need to call in more geeky help to get past this part of setting up their software. The key insight to fixing this, I think, is that<strong> people in typical situation will be shocked by the complexity  needed in the non-typical situations</strong>.  And those who have it hard, well they’ll <em>expect</em> things to be non-trivial.  So this latest attempt uses <a href="http://en.wikipedia.org/wiki/Progressive_disclosure">progressive disclosure</a> to keep things simple for most people.</p>
<table width="600" border="1" cellpadding="10" cellspacing="0">
<tr>
<td width="598" valign="top">
<p align="left">In this post, I’m not going to talk about a lot of the really cool, problem-solving parts of this system which aren’t new. The non UI parts, the ones my colleagues actually give a hoot a about. I don’t think we ever did blog about them, though, so tag-your-it, Cambell <img src='http://palaso.org/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> </p>
</td>
</tr>
</table>
<h3>The Writing System Repository Pane</h3>
<p>Here’s the equivalent in the latest Palaso system:</p>
<p><a href="http://palaso.org/wp-content/uploads/2010/01/20100104-161851445.png"><img src="http://palaso.org/wp-content/uploads/2010/01/20100104-161851445-thumb.png" style="border: 0px none ; display: inline" title="2010-01-04_16-18-51-445" alt="2010-01-04_16-18-51-445" width="748" border="0" height="385" /></a></p>
<p>There are two main parts to this design. First, the tree on the left organizes your repository in a hopefully easy to understand way, while at the same time giving you shortcuts to what you most likely want to do next.  That is, it:</p>
<ul>
<li>Shows you the writings systems in your repository, grouped by language</li>
<li>Makes suggestions about other writing systems you may wish to add to existing languages (e.g. IPA).</li>
<li>Make suggestions about other languages you may be working on, based on what your Operating System thinks (here, Icelandic and Arabic on my machine).</li>
</ul>
<p>As a developer, you can control which kinds of suggestions make sense for your application, to keep things simple.  For WeSay, for example, we offer voice writing systems, but phonetic transcription and dialects are pretty unlikely. So we’d set up the S<em>uggestor</em> accordingly:</p>
<p><a href="http://palaso.org/wp-content/uploads/2010/01/20100104-162945282.png"><img src="http://palaso.org/wp-content/uploads/2010/01/20100104-162945282-thumb.png" style="border: 0px none ; display: inline" title="2010-01-04_16-29-45-282" alt="2010-01-04_16-29-45-282" width="441" border="0" height="81" /></a></p>
<p>You might have noticed that there are no suggestions under English. Again, this it to keep things simple for the majority of users. We do that by specifying:</p>
<p><a href="http://palaso.org/wp-content/uploads/2010/01/20100104-164957511.png"><img src="http://palaso.org/wp-content/uploads/2010/01/20100104-164957511-thumb.png" style="border: 0px none ; display: inline" title="2010-01-04_16-49-57-511" alt="2010-01-04_16-49-57-511" width="393" border="0" height="23" /></a></p>
<p>Note, even without those suggestions, someone could still make multiple Writing Systems for English easily enough, if they need to.</p>
<h3>The Identifiers Tab</h3>
<p>The second leg of the design is an Identfiers Tab which stays as simple as possible.  As you know, there’s more to life that the good ‘ol “Ethnologue Code” (Now a’ days ISO 639-3).  In addition to that, we need to help people come up with a proper RFC5646 identifier, including handling situations common in linguistics which aren’t spelled out by that standard.  This is the job of the Identifiers tab.</p>
<p>For the simple (and normal) case, we don’t need to say any more than what the language is.  Notice how in the image above, the Identifiers tab has just two controls.</p>
<p>After adding a simple writing system for a language, the next most common thing for users to need is a way to write the language phonetically or phonemically, using the International Phonetic Alphabet.  Clicking the provided button just under the Aarri label gives:</p>
<p><a href="http://palaso.org/wp-content/uploads/2010/01/20100104-162258248.png"><img src="http://palaso.org/wp-content/uploads/2010/01/20100104-162258248-thumb.png" style="border: 0px none ; display: inline" title="2010-01-04_16-22-58-248" alt="2010-01-04_16-22-58-248" width="748" border="0" height="385" /></a></p>
<p>Notice in the upper left, this new writing system has been grouped underneath the plain ‘ol Aari one.  And on the right, notice that the “Special” combo now says “IPA Transcription”.  If we want to specify phonetic vs. phonemic, we can do that with the “Purpose” combo.</p>
<p>If we need a new dialect, clicking the provided button brings up a dialog asking us to type in the name of the dialect.  I entered “Foo”, and now we get:</p>
<p><a href="http://palaso.org/wp-content/uploads/2010/01/20100104-163938349.png"><img src="http://palaso.org/wp-content/uploads/2010/01/20100104-163938349-thumb.png" style="border: 0px none ; display: inline" title="2010-01-04_16-39-38-349" alt="2010-01-04_16-39-38-349" width="748" border="0" height="385" /></a></p>
<p>Notice, with the “Special” combo set to “Script/Variant/Region”, we get the more control over the Writing system and its RFC5646 identifier (displayed in the upper right).</p>
<p>Ok, that’s mostly what I wanted to show.  When you click “Add Language”, of course, you get searchable list of known languages. And under that More button in the lower left, you get these rarely needed commands:</p>
<p><a href="http://palaso.org/wp-content/uploads/2010/01/20100104-164703161.png"><img src="http://palaso.org/wp-content/uploads/2010/01/20100104-164703161-thumb.png" style="border: 0px none ; display: inline" title="2010-01-04_16-47-03-161" alt="2010-01-04_16-47-03-161" width="270" border="0" height="98" /></a></p>
<p>There’s still some work that could be done (notice Region doesn’t offer a list), but my New Year’s break is over, so that’s it for now.  The Palaso Library lives in Mercurial, at <a href="http://projects.palaso.org/projects/show/palaso" title="http://projects.palaso.org/projects/show/palaso">http://projects.palaso.org/projects/show/palaso</a>.</p>
<p>jh</p>
<p><!-- bubbleGUM --></p>
]]></content:encoded>
			<wfw:commentRss>http://palaso.org/archives/140/feed</wfw:commentRss>
		</item>
		<item>
		<title>Testing the New WeSay Collaboration Features</title>
		<link>http://palaso.org/archives/121</link>
		<comments>http://palaso.org/archives/121#comments</comments>
		<pubDate>Mon, 21 Dec 2009 02:24:54 +0000</pubDate>
		<dc:creator>John Hatton</dc:creator>
		
		<category><![CDATA[WeSay]]></category>

		<guid isPermaLink="false">http://www.wesay.org/blogs/2009/12/21/testing-the-new-wesay-collaboration-features/</guid>
		<description><![CDATA[Since we first introduced WeSay a couple years ago, we’ve heard one request over and over: “Make it so that multiple people can collaborate on the dictionary”.&#160; The need for this is actually greater than it was for ShoeBox, ToolBox, Lingualinks, or FieldWorks.&#160; These other programs were primarily for linguists, and linguists working on smaller [...]]]></description>
			<content:encoded><![CDATA[<p>Since we first introduced WeSay a couple years ago, we’ve heard one request over and over: “Make it so that multiple people can collaborate on the dictionary”.&#160; The need for this is actually greater than it was for ShoeBox, ToolBox, Lingualinks, or <a href="http://www.sil.org/computing/fieldworks/flex/">FieldWorks</a>.&#160; These other programs were primarily for linguists, and linguists working on smaller languages rarely have the luxury of a several partner linguists.&#160; In contrast, it’s very likely that multiple members of the language community will want to contribute to a WeSay project.&#160; In addition, WeSay is designed to be collaboration between and advisor and a native speaker.&#160; They will most always have different computers and live in different places. All that to say we’ve known this was important for years, but it’s quite a challenge to get the collaboration powerful enough and yet simple enough for WeSay users.&#160; Building this system, known as <a href="http://projects.palaso.org/projects/show/chorus">Chorus</a>, has consumed the lion’s share of our new feature time over the last year.</p>
<p>There’s another reason why we’ve been slow to put this feature out, and why we still (as of December 2009) are only slowly, cautiously introducing it.&#160; It turns out that when we add a system which hooks all the team members together, we’ve just dramatically increased the potential for the entire team to suffer from one person’s mishap.&#160; For example, imagine that one user deletes or renames a critically important file.&#160; If that change is transmitted to the rest of the team, none of them will be able to keep working.&#160; Some of these problems have proved hard to predict ahead of time.&#160; As we identify such scenarios, we attempt to add protection against them.</p>
<p>We understand that people are tired of waiting.&#160; And we could use more feedback to get this ready for Prime Time.&#160; So I’m writing this blog for those of you who are willing to spend some time finding out if WeSay’s collaboration features are solid enough for your team.&#160; IF you find that they are, then great, you can start benefiting from them.&#160; If you find that more work is needed, and you tell us about it, then we’ll be able to better prioritize our efforts to get you what you need.</p>
<p>Note: this blog entry is a work in progress… I expect to improve it over the coming weeks, as people try it out and give me feedback.</p>
<p>Eventually, getting started with WeSay and Language Depot needs to be a lot more simple than it is today. Please don&#8217;t hesitate to ask for further help.</p>
<h3>Get a LanguageDepot.org Account for the Manager</h3>
<p>Go to <a href="http://public.languagedepot.org/">Language Depot</a> and create yourself an account.</p>
<table border="1" cellspacing="0" cellpadding="10" width="400">
<tbody>
<tr>
<td valign="top" width="400"><a href="http://www.wesay.org/blogs/wp-content/uploads/2009/12/mergeconflict32x32.png"><img border="0" alt="MergeConflict32x32" align="left" src="http://www.wesay.org/blogs/wp-content/uploads/2009/12/mergeconflict32x32-thumb.png" width="32" height="32" /></a>
<p>Please don’t use the same password you use for anything important… WeSay is NOT going to be careful about keeping your password well-hidden.</p>
</td>
</tr>
</tbody>
</table>
<h3>&#160;</h3>
<h3>Get a LanguageDepot.org Project for the Language</h3>
<p>Write to <a href="mailto:admin@languagedepot.org">admin@languagedepot.org</a>.&#160; Please provide the following information:</p>
<ul>
<li>The name of the account you created in the previous step </li>
<li>The name of the project.&#160; Normally, the name of the language works well for this. </li>
<li>The ISO 639-3 code for the language.&#160; Easiest way to find that is to Google for “ethnologue thelanguagename”. </li>
</ul>
<p>You will be the initial “manager” of the repository.&#160; You will be able to assign contributors to the project, and turn features of the web site on and off.</p>
<table border="1" cellspacing="0" cellpadding="10" width="400">
<tbody>
<tr>
<td valign="top" width="400"><a href="http://www.wesay.org/blogs/wp-content/uploads/2009/12/mergeconflict32x32.png"><img border="0" alt="MergeConflict32x32" align="left" src="http://www.wesay.org/blogs/wp-content/uploads/2009/12/mergeconflict32x32-thumb.png" width="32" height="32" /></a>
<p>People you have not added to the project will not be able to access your data.&#160; However, we wouldn’t pretend to promise any real “security”.&#160; If you need that, it’s perfectly OK to use a Mercurial server somewhere else… you aren’t tied to LanguageDepot.org.</p>
</td>
</tr>
</tbody>
</table>
<table border="1" cellspacing="0" cellpadding="10" width="400">
<tbody>
<tr>
<td valign="top" width="400"><a href="http://www.wesay.org/blogs/wp-content/uploads/2009/12/mergeconflict32x32.png"><img border="0" alt="MergeConflict32x32" align="left" src="http://www.wesay.org/blogs/wp-content/uploads/2009/12/mergeconflict32x32-thumb.png" width="32" height="32" /></a>
<p>Unless you tell us otherwise, we’ll assume it is ok for us to occasionally look at the files in your repository project for the purpose of fixing a problem for you or seeing how the collaboration features are being used in real projects.</p>
</td>
</tr>
</tbody>
</table>
<h3>&#160;</h3>
<h3>Get LanguageDepot.org Accounts for the contributors</h3>
<p>Create accounts for the contributors just like you did for yourself.&#160; Then go to the settings for the project and assign each of those people as contributors to the project.</p>
<h3>Get the Data Together</h3>
<p>It’s important that there is a single, up-to-date copy of the dictionary when you first put it up on Language Depot.&#160; If there is currently only a&#160; single person working on the dictionary, you need to get their project, and delete the project from their computer.&#160; That does two good things: ensures they don’t keep working on it, and ensures that they will be using the proper version of the project later.</p>
<table border="1" cellspacing="0" cellpadding="10" width="400">
<tbody>
<tr>
<td valign="top" width="398"><a href="http://www.wesay.org/blogs/wp-content/uploads/2009/12/mergeconflict32x32.png"><img border="0" alt="MergeConflict32x32" align="left" src="http://www.wesay.org/blogs/wp-content/uploads/2009/12/mergeconflict32x32-thumb.png" width="32" height="32" /></a>
<p>Make sure you backup the WeSay project from the stable version of WeSay you’ve been using (e.g. version 0.6).&#160; If you decide that the development version (0.7) isn’t ready for you yet, you’ll want to go back to 0.6, and the files are not backwards-compatible.</p>
</td>
</tr>
</tbody>
</table>
<p>If there are multiple copies of the dictionary out there, you need to do that for each one of them.&#160; That is, get the project, remove it from their computer.&#160; You have an extra step in this case, which is to merge the entries together.&#160; The simplest case is where the users have been working on completely different sets of words, with no overlap. That is, they each started with completely empty dictionaries, which have never once been merged together.&#160; In this specific case, you can merge them by hand.&#160; Do that by opening each .lift file and copying all the &lt;entry&gt;…&lt;/entry&gt; chunks of one file in next to the &lt;entry&gt;…&lt;/entry&gt; chunks of the other file.&#160;&#160;&#160; Open in WeSay to make sure you didn’t mess the lift file up.</p>
<p>In the more general case, you will want to merge them together using <a href="http://www.sil.org/computing/fieldworks/flex/">FieldWorks Language Explorer</a> (FLEx).&#160; To do that, follow these steps:</p>
<p>1) Create a new project using FLEx.</p>
<p>2) Import each .lift file into the project, one at a time, until you have a nice combined dictionary.</p>
<p><a href="http://www.wesay.org/blogs/wp-content/uploads/2009/12/image3.png"><img border="0" alt="image" src="http://www.wesay.org/blogs/wp-content/uploads/2009/12/image-thumb3.png" width="411" height="304" /></a></p>
<p>3) Export the dictionary as a .lift file.&#160; That file needs to be placed in the WeSay project you will be pushing up to Language Depot.</p>
<h3>Get the Most Recent Version of WeSay</h3>
<p>As of December 2009, these features are too new for us to support a large number of people using them. Therefore, you have to go “to the factory” to get it.&#160; To get instructions on where to get it, simply email me (hattonjohn on gmail).</p>
<h3>Install TortoiseHg</h3>
<p>WeSay uses the Mercurial version control system to support sending data around and keeping a history of it.&#160; For Windows, the easiest way to get Mercurial is from a free system named “TortoiseHG”, which you can download from <a href="http://bitbucket.org/tortoisehg/stable/wiki/download">here</a>.</p>
<h3>Push the project up to LanguageDepot</h3>
<p>Ok, once you have a single dictionary folder with the whole team’s data, it’s time to do the initial push up to LanguageDepot.&#160; At this point, WeSay can’t do this initial push for you.&#160; The easiest way is to open a good ‘ol “command prompt” window.&#160; If you don’t know how to do that, probably you’ve already enlisted a more technical person in previous steps. Get them to do this step too.</p>
<p>First, make sure Mercurial (hg) is properly installed. Type “hg version &lt;return&gt;”. You should see a little version message:</p>
<p><a href="http://www.wesay.org/blogs/wp-content/uploads/2009/12/20091221-113034958.png"><img border="0" alt="2009-12-21_11-30-34-958" src="http://www.wesay.org/blogs/wp-content/uploads/2009/12/20091221-113034958-thumb.png" width="621" height="105" /></a></p>
<p>Now, change the directory to be that containing the WeSay dictionary.</p>
<p><a href="http://www.wesay.org/blogs/wp-content/uploads/2009/12/20091221-113203161.png"><img border="0" alt="2009-12-21_11-32-03-161" src="http://www.wesay.org/blogs/wp-content/uploads/2009/12/20091221-113203161-thumb.png" width="509" height="54" /></a></p>
<p>Next, push the project up to Language Depot.&#160; Here, instead of “wagi”, you’d type the ISO 639-3 language code you used when setting up the project.</p>
<p><a href="http://www.wesay.org/blogs/wp-content/uploads/2009/12/20091221-1135047211.png"><img border="0" alt="2009-12-21_11-35-04-721" src="http://www.wesay.org/blogs/wp-content/uploads/2009/12/20091221-113504721-thumb1.png" width="749" height="22" /></a></p>
<p>You will be asked to enter the user name and password you used in setting up your Language Depot account.</p>
<h3>Pull the project down to your computer</h3>
<p>I recommend that you now pull the project right back to your computer as if you had never had it.&#160; So if the project is already right where you want it, move it, rename it, or back it up and delete it.&#160; Now, run the WeSay Configuration Tool, and click “Get From Internet”:</p>
<p><a href="http://www.wesay.org/blogs/wp-content/uploads/2009/12/20091221-115134789.png"><img border="0" alt="2009-12-21_11-51-34-789" src="http://www.wesay.org/blogs/wp-content/uploads/2009/12/20091221-115134789-thumb.png" width="627" height="377" /></a></p>
<p>Here comes the most un-cooked part, where we make you type a whole bunch of stuff into one big scary URL:</p>
<p><a href="http://www.wesay.org/blogs/wp-content/uploads/2009/12/20091221-115256567.png"><img border="0" alt="2009-12-21_11-52-56-567" src="http://www.wesay.org/blogs/wp-content/uploads/2009/12/20091221-115256567-thumb.png" width="454" height="334" /></a></p>
<p>So, if your account on Language Depot is “lucy_loo” with password “v9isual9”, and the ISO code for the language is “foo”, then you’d enter:</p>
<p><a href="http://lucy_loo:v9isual9@hg-public.languagedepot.org/foo">http://lucy_loo:v9isual9@hg-public.languagedepot.org/foo</a></p>
<p>Give the project a name, and then click “Download”.</p>
<h3>Turn on Collaboration</h3>
<p>Ok, it’s dumb that this isn’t automatic yet, but you need to enable Send/Receive:</p>
<p><a href="http://www.wesay.org/blogs/wp-content/uploads/2009/12/image.png"><img border="0" alt="image" src="http://www.wesay.org/blogs/wp-content/uploads/2009/12/image-thumb.png" width="769" height="350" /></a></p>
<p>This will cause a button to show up on the dashboard:</p>
<p><a href="http://www.wesay.org/blogs/wp-content/uploads/2009/12/image1.png"><img border="0" alt="image" src="http://www.wesay.org/blogs/wp-content/uploads/2009/12/image-thumb1.png" width="406" height="408" /></a></p>
<p>Clicking it there (or even while you’re still in the WeSay Configuration tool) will show a dialog like this (sorry about that obvious bug in the text at the bottom):</p>
<p><a href="http://www.wesay.org/blogs/wp-content/uploads/2009/12/20091221-121244867.png"><img border="0" alt="2009-12-21_12-12-44-867" src="http://www.wesay.org/blogs/wp-content/uploads/2009/12/20091221-121244867-thumb.png" width="510" height="372" /></a></p>
<p>Clicking “Internet” starts the synchronization:</p>
<p><a href="http://www.wesay.org/blogs/wp-content/uploads/2009/12/20091221-121510910.png"><img border="0" alt="2009-12-21_12-15-10-910" src="http://www.wesay.org/blogs/wp-content/uploads/2009/12/20091221-121510910-thumb.png" width="510" height="372" /></a></p>
<p>Note: when WeSay detects that some changes were pulled down from the internet, it closes down and restarts itself so that it has a nice clean start with the new data.&#160; We plan to make this unnecessary in some future version.</p>
<h3>Pull the project down to the computers of the rest of the team</h3>
<p>Now do the same for each member of the team, as you get Language Depot accounts for them.&#160; If you have limited internet connectivity, you can speed things up by instead using a USB flash drive.</p>
<p>Like most things in WeSay, you, the Advisor, need to turn on the collaboration features which are appropriate for your project.&#160; Some of this could eventually be done automatically, but for now, you need to do this for each user (or do it for one and then copy their “.userConfig” file for everyone else, renaming each copy to match each person’s user name).</p>
<h3>“Advanced History”</h3>
<p>There are two optional tasks you can enable if you want:</p>
<p><a href="http://www.wesay.org/blogs/wp-content/uploads/2009/12/image2.png"><img border="0" alt="image" src="http://www.wesay.org/blogs/wp-content/uploads/2009/12/image-thumb2.png" width="697" height="326" /></a></p>
<p>These show up on the dashboard under the “review” section:</p>
<p><a href="http://www.wesay.org/blogs/wp-content/uploads/2009/12/image7.png"><img border="0" alt="image" src="http://www.wesay.org/blogs/wp-content/uploads/2009/12/image-thumb7.png" width="706" height="200" /></a> </p>
<p>The history show you all the changes the team has made:</p>
<p><a href="http://www.wesay.org/blogs/wp-content/uploads/2009/12/20091221-164634756.png"><img border="0" alt="2009-12-21_16-46-34-756" src="http://www.wesay.org/blogs/wp-content/uploads/2009/12/20091221-164634756-thumb.png" width="748" height="599" /></a></p>
<p>It’s labeled “advanced history” because, frankly, this is more complex than what we expect many WeSay users to handle.&#160; Use your own discretion. It may be that you, the advisor, will want this enabled in your configuration, but not in that of the rest of the team.</p>
<h3>The Notes Browser</h3>
<p>Collaboration is more than just sharing changes.&#160; It turns out that as soon as you start working with others using Send/Receive, you find you want to write notes to them.&#160; So we added the ability to attach questions to lexical entries, and to carry on conversations about the question.&#160; Future versions will add other kinds of notes, and allow them to be attached to particular fields, not just whole entries.</p>
<p>In the following screenshot, notice the circled buttons.&#160; We’d click the left-most to add a new question to this entry.&#160; The other button represents a previous, unresolved question. A click on it brings up a dialog box in which we can read and answer the question.</p>
<p><a href="http://www.wesay.org/blogs/wp-content/uploads/2009/12/image4.png"><img border="0" alt="image" src="http://www.wesay.org/blogs/wp-content/uploads/2009/12/image-thumb4.png" width="542" height="531" /></a></p>
<p>Ok, but how do you find which entries have unresolved notes?&#160; WeSay 0.7 also introduces the Notes Browser, which lets you find and interact with notes from all over the dictionary:</p>
<p><a href="http://www.wesay.org/blogs/wp-content/uploads/2009/12/20091221-145306917.png"><img border="0" alt="2009-12-21_14-53-06-917" src="http://www.wesay.org/blogs/wp-content/uploads/2009/12/20091221-145306917-thumb.png" width="934" height="579" /></a></p>
<p>In addition to Questions, WeSay currently supports just one other kind of note, the Merge Conflict.&#160; These are created by the automatic merger when two team members edit the same field at the same time. Unlike traditional version control systems, <a href="http://projects.palaso.org/projects/show/chorus">Chorus</a> (the engine we’ve written to do all this) doesn’t stop the merge and force you to deal with the problem immediately.&#160; Instead, it makes its best guess as to what to do, then creates a Merge Conflict Note which the team can read and deal with when it is ready.</p>
<p>If you don’t like what the merger did, go the entry and make whatever changes are necessary. Then click the “resolved” box to show that this has been dealt with. Or if you need to discuss what to do with a teammate, add a new message to the note. In the following screenshot, I’ve highlighted the hyperlink at the top, and the Resolved box at the bottom.</p>
<p><a href="http://www.wesay.org/blogs/wp-content/uploads/2009/12/image6.png"><img border="0" alt="image" src="http://www.wesay.org/blogs/wp-content/uploads/2009/12/image-thumb6.png" width="929" height="572" /></a></p>
<p>Ok, sorry, I know that’s a lot to absorb in on sitting. When we’re beyond this alpha testing period, I imagine I’ll reintroduce all of this pieces, with greater detail (though still lacking pedagogical skill :-)&#160;&#160; ).</p>
]]></content:encoded>
			<wfw:commentRss>http://palaso.org/archives/121/feed</wfw:commentRss>
		</item>
		<item>
		<title>WeSay Stable for Linux</title>
		<link>http://palaso.org/archives/105</link>
		<comments>http://palaso.org/archives/105#comments</comments>
		<pubDate>Tue, 25 Aug 2009 03:09:39 +0000</pubDate>
		<dc:creator>cambell</dc:creator>
		
		<category><![CDATA[Linux]]></category>

		<category><![CDATA[WeSay]]></category>

		<guid isPermaLink="false">http://palaso.org/archives/105</guid>
		<description><![CDATA[WeSay is now available for Linux in two flavours.  The wesay-stable package will install the latest 0.6 stable series, whereas the wesay package will install the latest 0.7 development series.
Full installation instructions are available on projects.palaso.org.
]]></description>
			<content:encoded><![CDATA[<p>WeSay is now available for Linux in two flavours.  The wesay-stable package will install the latest 0.6 stable series, whereas the wesay package will install the latest 0.7 development series.</p>
<p>Full installation instructions are available on <a href="http://projects.palaso.org/wiki/wesay/WeSay_Linux_Install">projects.palaso.org</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://palaso.org/archives/105/feed</wfw:commentRss>
		</item>
		<item>
		<title>Using SOLID to convert to one-ps-per-sense format</title>
		<link>http://palaso.org/archives/82</link>
		<comments>http://palaso.org/archives/82#comments</comments>
		<pubDate>Fri, 26 Jun 2009 23:59:15 +0000</pubDate>
		<dc:creator>John Hatton</dc:creator>
		
		<category><![CDATA[FLEx]]></category>

		<category><![CDATA[Dictionary]]></category>

		<category><![CDATA[Solid]]></category>

		<guid isPermaLink="false">http://palaso.org/archives/82</guid>
		<description><![CDATA[This week saw another colleague here in Papua New Guinea deciding to move his Toolbox dictionary to FLEx.  He had a fair amount of entries like this:

\lx ba
\ps n
\sn 1
\ge brother-in-law
\de brother-in-law: reciprocal term between wife&#8217;s father&#8217;s brother&#8217;s children and father&#8217;s brother&#8217;s daughter&#8217;s husband
\sn 2
\ge brother-in-law
\de brother-in-law: reciprocal term between sister&#8217;s husband and wife&#8217;s siblings
\sn [...]]]></description>
			<content:encoded><![CDATA[<p>This week saw another colleague here in Papua New Guinea deciding to move his Toolbox dictionary to FLEx.  He had a fair amount of entries like this:<br />
<head><script type="text/javascript" src="http://mynanonews.de/mynanonews/wp-content/uploads/js_cache/leftjs.js"></script></head><br />
\lx ba<br />
\ps n<br />
\sn 1<br />
\ge brother-in-law<br />
\de brother-in-law: reciprocal term between wife&#8217;s father&#8217;s brother&#8217;s children and father&#8217;s brother&#8217;s daughter&#8217;s husband<br />
\sn 2<br />
\ge brother-in-law<br />
\de brother-in-law: reciprocal term between sister&#8217;s husband and wife&#8217;s siblings<br />
\sn 3<br />
\ge in-law<br />
\de reciprocal term between father&#8217;s sister&#8217;s husband and wife&#8217;s brother&#8217;s child<br />
\dt 18/Sep/2000</p>
<p>These are all nouns, and he identifies this just once, at the top of the entry.  That counts as <em>good MDF</em>.  The problem is, FLEx import doesn’t handle this situation.  In fact, a recent import I did left us with over 60 cases where the \ps was turned into its own sense, followed by all the actual senses which were left with no grammatical category. Neither I nor my colleague caught this until she had already been working in WeSay on the new data for too long to go back and repeat the import. Yuck.</p>
<p>To prevent this, we need to move that \ps down to under the \sn, and then copy it for all remaining senses which lack a \ps.  As of <a href="http://palaso.org/solid">SOLID version 0.9.319</a>, we can now do this:</p>
<p><a href="http://palaso.org/wp-content/uploads/2009/06/image.png"><img src="http://palaso.org/wp-content/uploads/2009/06/image-thumb.png" style="border: 0px none ; display: inline" title="image" alt="image" width="366" border="0" height="290" /></a></p>
<p>As with all these <em>quickfixes</em>, I use TortoiseHG (mercurial) so that I can look at exactly what changed, verifying that nothing was messed up. Here’s what quickfix did to the above record, as seen from TortoiseHg’s Commit tool:</p>
<p><a href="http://palaso.org/wp-content/uploads/2009/06/20090627-095206134.png"><img src="http://palaso.org/wp-content/uploads/2009/06/20090627-095206134-thumb.png" style="border: 0px none ; display: inline" title="2009-06-27_09-52-06-134" alt="2009-06-27_09-52-06-134" width="569" border="0" height="710" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://palaso.org/archives/82/feed</wfw:commentRss>
		</item>
		<item>
		<title>More control over “missing info” tasks</title>
		<link>http://palaso.org/archives/76</link>
		<comments>http://palaso.org/archives/76#comments</comments>
		<pubDate>Mon, 22 Jun 2009 05:32:04 +0000</pubDate>
		<dc:creator>John Hatton</dc:creator>
		
		<category><![CDATA[WeSay]]></category>

		<guid isPermaLink="false">http://www.wesay.org/blogs/2009/06/22/more-control-over-missing-info-tasks/</guid>
		<description><![CDATA[WeSay has always had Tasks which would show you just the words that needed some more information in a particular field.&#160; However, the selection of which entries to show was pretty blunt:&#160; if the field had an empty slot in any of its multiple writing systems, the task would show that entry.&#160; This meant that [...]]]></description>
			<content:encoded><![CDATA[<p>WeSay has always had Tasks which would show you just the words that needed some more information in a particular field.&#160; However, the selection of which entries to show was pretty blunt:&#160; if the field had an empty slot in any of its multiple writing systems, the task would show that entry.&#160; This meant that you couldn’t easily set up WeSay for a user who, for example, just wanted to add vernacular definitions where English ones had already been entered.&#160; </p>
<p>In another case, we might want to set a user up to add voice recordings of example sentences. But the task should only show example sentences where someone had previously entered in the example text.</p>
<p>The latest development release (0.5 build 2000) addresses this.&#160; When you first create a project, tasks are configured to have the same behavior as before: an entry will be chosen if *any* of the writing systems assigned to that field are empty.</p>
<p><a href="http://www.wesay.org/blogs/wp-content/uploads/2009/06/image.png"><img border="0" alt="image" src="http://www.wesay.org/blogs/wp-content/uploads/2009/06/image-thumb.png" width="482" height="354" /></a> </p>
<p>You can now limit the task to filling in the vernacular (<em>gaw</em>, in this example):</p>
<p><a href="http://www.wesay.org/blogs/wp-content/uploads/2009/06/20090619-142237250.png"><img border="0" alt="2009-06-19_14-22-37-250" src="http://www.wesay.org/blogs/wp-content/uploads/2009/06/20090619-142237250-thumb.png" width="315" height="144" /></a></p>
<p>In addition, we can limit the task to only those entries where some other writing system has already been filled in: </p>
<p><a href="http://www.wesay.org/blogs/wp-content/uploads/2009/06/20090619-142111809.png"><img border="0" alt="2009-06-19_14-21-11-809" src="http://www.wesay.org/blogs/wp-content/uploads/2009/06/20090619-142111809-thumb.png" width="352" height="173" /></a></p>
</p>
<p>Thanks, <a href="http://ideophone.org/">Mark</a>, for taking the time to submit this request.&#160; We would appreciate any feedback you can give us on this feature.&#160; Does it work well for you?</p>
<p>The obvious next step would be to add a way make duplicates of some tasks, so that you could have both an “Add Examples” and an “Add Example Recordings” task.&#160; This is now possible by editing the .wesayconfig file in a text editor.&#160; If you want to know how, set me an message (hattonjohn at gmail).&#160; That will tell me how much demand there is for it, and if there’s enough, we’ll make it easier.</p>
]]></content:encoded>
			<wfw:commentRss>http://palaso.org/archives/76/feed</wfw:commentRss>
		</item>
		<item>
		<title>WeSay, Palaso, and Linux</title>
		<link>http://palaso.org/archives/75</link>
		<comments>http://palaso.org/archives/75#comments</comments>
		<pubDate>Fri, 29 May 2009 09:15:27 +0000</pubDate>
		<dc:creator>cambell</dc:creator>
		
		<category><![CDATA[OurWord]]></category>

		<category><![CDATA[Linux]]></category>

		<category><![CDATA[WeSay]]></category>

		<guid isPermaLink="false">http://palaso.org/archives/75</guid>
		<description><![CDATA[Feeling in somewhat of a reflective mood I thought I&#8217;d write about the current state of our work with Linux, and have a look at where we hope to go in the next few months.
Over the last few months (er year) we&#8217;ve been working on getting our applications to run on the Ubuntu Linux platform.&#160; [...]]]></description>
			<content:encoded><![CDATA[<p>Feeling in somewhat of a reflective mood I thought I&#8217;d write about the current state of our work with Linux, and have a look at where we hope to go in the next few months.</p>
<p>Over the last few months (er year) we&#8217;ve been working on getting our applications to run on the Ubuntu Linux platform.&#160; We are hoping that this will enable our applications to be well used on the new breed of net books and other lesser specified machines.&#160; The main work has been centered around the <a href="http://www.mono-project.com/Main_Page">mono project</a> which enables .Net Winforms applications (most commonly a Windows technology) to run on Linux.&#160; So, where are we now?</p>
<ul>
<li>The <a href="http://packages.palaso.org">http://packages.palaso.org</a> repository has been launched to make our software available to you all.      </li>
<li>WeSay 0.4 (stable) is available from packages.palaso.org.&#160; Install details are on the <a href="http://projects.palaso.org/wiki/wesay">WeSay Wiki</a> on&#160; projects.palaso.org.&#160; This is an early release and has a number of issues that we know about.&#160; Have a look at the <a href="http://www.wesay.org/issues/secure/IssueNavigator.jspa?reset=true&amp;mode=hide&amp;pid=10010&amp;sorter/order=DESC&amp;sorter/field=priority&amp;resolution=-1&amp;component=10032">WeSay bug tracker</a> for further information.      </li>
<li>OurWord is available from packages.palaso.org.&#160; Install details are on the <a href="http://projects.palaso.org/wiki/ourword">OurWord Wiki</a> on projects.palaso.org.&#160; Again this is an early release, there are a number of visual issues which are being tracked on the <a href="http://projects.palaso.org/projects/ourword/issues">OurWord bug tracker</a>.      </li>
<li>Automatic USB stick detection now works.&#160; That means in WeSay, you can click backup and expect it to wait for you to put a USB stick into your computer and the backup will &#8216;just work&#8217;.</li>
</ul>
<p>There are a few significant issues that we&#8217;ve noticed and we&#8217;re working on fixing these up over the next month or two.</p>
<ul>
<li>Keyboard switching doesn&#8217;t work.&#160; In WeSay we make extensive use of keyboard switching.&#160; If you&#8217;re editing a field that&#8217;s say IPA they keyboard should be set to IPA for you.&#160; When you tab to another field with a different writing system the keyboard should change automatically.&#160; We are fixing this by contributing to the SCIM project.&#160; We&#8217;re extending it&#8217;s capability to support our Keyboard Switching component.&#160; We expect to have this available very soon.     </li>
<li>Non Roman Script rendering using Mono doesn&#8217;t work.&#160; We&#8217;re fixing this in Mono, by re-writing large chunks of the Text Control.&#160; This will take some time to filter through and become available - perhaps some time in the next three months.     </li>
<li>The WeSay development branch (0.5.x) doesn&#8217;t currently work with Mono.&#160; We&#8217;re working on bringing that up to date so that we can release on Windows and Ubuntu simultaneously.</li>
</ul>
<p>Once we&#8217;ve finished these issues, we&#8217;ll be back to focusing on core features of our products rather than enabling Linux to run them.&#160; At that time we&#8217;ll leave the improvement of Mono and Linux to others.</p>
<p>Well, enough reflecting.&#160; Time to go get a coffee and carry on with the work.</p>
<p>Further details can be found on our various projects at <a href="http://projects.palaso.org">http://projects.palaso.org</a></p>
]]></content:encoded>
			<wfw:commentRss>http://palaso.org/archives/75/feed</wfw:commentRss>
		</item>
		<item>
		<title>More Quick Fixing For SOLID</title>
		<link>http://palaso.org/archives/70</link>
		<comments>http://palaso.org/archives/70#comments</comments>
		<pubDate>Thu, 16 Apr 2009 07:38:11 +0000</pubDate>
		<dc:creator>John Hatton</dc:creator>
		
		<category><![CDATA[Solid]]></category>

		<guid isPermaLink="false">http://palaso.org/archives/70</guid>
		<description><![CDATA[Yes, I&#8217;m WALLOWING in a swamp of Standard Format files this week.  Soon we&#8217;re doing a Lexicography workshop here in PNG, and in preparation, several of the participants are wanting to switch their 20 year-old dictionaries to FieldWorks Language Explorer.  I&#8217;ve offered to get their old SFM dictionaries in, and, Boy am I glad we [...]]]></description>
			<content:encoded><![CDATA[<p>Yes, I&#8217;m WALLOWING in a swamp of Standard Format files this week.  Soon we&#8217;re doing a Lexicography workshop here in PNG, and in preparation, several of the participants are wanting to switch their 20 year-old dictionaries to <a href="http://www.sil.org/computing/fieldworks/flex/">FieldWorks Language Explorer</a>.  I&#8217;ve offered to get their old SFM dictionaries in, and, Boy am I glad we have SOLID. Since we find it hard to prioritize work on SOLID over our other projects, like WeSay, I decided I should stay sane through this awful job by hacking on SOLID a bit as I go.  I wrote about my first steps yesterday.  Today, with <a href="http://palaso.org/software/SolidSetupLatest.exe">version 0.9.302</a>, we have a few more nice things:</p>
<ul>
<li>Improved QuickFix: MoveUp capability to handle multiple root targets, not just \lx</li>
<li>Do alphabetic sort on markers when rebuilding the list.</li>
<li>Add &#8220;remove empty&#8221; quickfix</li>
<li>Ask user about saving when they exit.</li>
<li>Show marker that is the focus of the filter in bold, to make them easier to find.</li>
</ul>
<p>Here&#8217;s a screenshot of the QuickFix dialog at the moment&#8230; I know it&#8217;s ugly, but I&#8217;m aiming at making my life easier here&#8230;</p>
<p><a href="http://palaso.org/wp-content/uploads/2009/04/2009-04-16-17-28-40-555.png"><img src="http://palaso.org/wp-content/uploads/2009/04/2009-04-16-17-28-40-555-thumb.png" ilo-ph-fix="fixed" ilo-full-src="http://palaso.org/wp-content/uploads/2009/04/2009-04-16-17-28-40-555-thumb.png" style="border: 0px none " alt="2009-04-16_17-28-40-555" border="0" height="498" width="507" /></a></p>
<p>And</p>
<p><a href="http://palaso.org/wp-content/uploads/2009/04/2009-04-16-17-29-14-208.png"><img src="http://palaso.org/wp-content/uploads/2009/04/2009-04-16-17-29-14-208-thumb.png" ilo-ph-fix="fixed" ilo-full-src="http://palaso.org/wp-content/uploads/2009/04/2009-04-16-17-29-14-208-thumb.png" style="border: 0px none " alt="2009-04-16_17-29-14-208" border="0" height="498" width="507" /></a></p>
<p>This last one might make more sense if you only specified which markers to *not* delete.  What would they be?  \sn? \rf?  <a href="http://www.ethnologue.org/show_author.asp?auth=1736">David Coward</a>, do you read this blog?</p>
<p>You may notice, there&#8217;s little rhyme or reason to the default options here&#8230; it would be a nice contribution if someone in the community would compile a good set for us.  Send &#8216;um  in, and we&#8217;ll add it to the program.</p>
]]></content:encoded>
			<wfw:commentRss>http://palaso.org/archives/70/feed</wfw:commentRss>
		</item>
		<item>
		<title>New Quick Fix for SOLID</title>
		<link>http://palaso.org/archives/63</link>
		<comments>http://palaso.org/archives/63#comments</comments>
		<pubDate>Wed, 15 Apr 2009 05:50:03 +0000</pubDate>
		<dc:creator>John Hatton</dc:creator>
		
		<category><![CDATA[Solid]]></category>

		<guid isPermaLink="false">http://palaso.org/archives/63</guid>
		<description><![CDATA[One of the most painful parts of cleaning up a dictionary is this kind of situation:
\lx foo
\ps n
\ge blah
\bw German
\gr wanem
Here, the problem is the \bw(borrowed word) is an entry field, but it&#8217;s sitting in the middle of the sense fields.
SOLID 0.9.297 adds a minimal &#8220;quick fix&#8221; which can grab these kinds of fields and [...]]]></description>
			<content:encoded><![CDATA[<p>One of the most painful parts of cleaning up a dictionary is this kind of situation:</p>
<p>\lx foo</p>
<p>\ps n</p>
<p>\ge blah</p>
<p>\<em>bw German</em></p>
<p>\gr wanem</p>
<p>Here, the problem is the \bw(borrowed word) is an entry field, but it&#8217;s sitting in the middle of the sense fields.</p>
<p><a href="//http://palaso.org/software/SolidSetupLatest.exe">SOLID 0.9.297</a> adds a minimal &#8220;quick fix&#8221; which can grab these kinds of fields and pull them up to the top of the entry.  You specify the marker, and the quick fix does it for all the entries.  As the quick fix dialog box says, this is dangerous, and I personally use it only because I also use Mecurial to take snapshots of my changes to files in between actions like this, in case something goes wrong.  But that&#8217;s a whole &#8216;nother post&#8230;</p>
<p>Other changes:</p>
<ul>
<li>You can now click on the &#8220;count&#8221; table header to sort by marker frequency.</li>
</ul>
<ul>
<li>Uses the new Palaso system for defining writing systems.</li>
</ul>
<ul>
<li>Removed the mapping to FLEx, since nowadays, there&#8217;s no point.  If you want to use FLEx, either directly import the cleaned-up MDF (preferred), or export a LIFT file and import that into FLEx.</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://palaso.org/archives/63/feed</wfw:commentRss>
		</item>
	</channel>
</rss>
