<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Language Detection</title>
	<atom:link href="http://www.dailydoseofexcel.com/archives/2010/03/15/language-detection/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.dailydoseofexcel.com/archives/2010/03/15/language-detection/</link>
	<description>Daily posts of Excel tips…and other stuff</description>
	<lastBuildDate>Thu, 09 Feb 2012 19:28:40 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
	<item>
		<title>By: James</title>
		<link>http://www.dailydoseofexcel.com/archives/2010/03/15/language-detection/#comment-44783</link>
		<dc:creator>James</dc:creator>
		<pubDate>Tue, 23 Mar 2010 09:52:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.dailydoseofexcel.com/?p=3699#comment-44783</guid>
		<description>&lt;p&gt;@Tushar,&lt;/p&gt;
&lt;p&gt;Thanks for the JSON parser ... which makes life much easier&lt;/p&gt;
&lt;p&gt;Cheers&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>@Tushar,</p>
<p>Thanks for the JSON parser &#8230; which makes life much easier</p>
<p>Cheers</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Tushar Mehta</title>
		<link>http://www.dailydoseofexcel.com/archives/2010/03/15/language-detection/#comment-44588</link>
		<dc:creator>Tushar Mehta</dc:creator>
		<pubDate>Mon, 15 Mar 2010 21:08:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.dailydoseofexcel.com/?p=3699#comment-44588</guid>
		<description>&lt;p&gt;Hi Dick:&lt;/p&gt;
&lt;p&gt;The Google response is in JSON.  Rather than parse the result yourself, get one &lt;a href=&quot;http://www.ediy.co.nz/vbjson-json-parser-library-in-vb6-xidc55680.html&quot; rel=&quot;nofollow&quot;&gt;http://www.ediy.co.nz/vbjson-json-parser-library-in-vb6-xidc55680.html&lt;/a&gt; or &lt;a href=&quot;http://code.google.com/p/vba-json/&quot; rel=&quot;nofollow&quot;&gt;http://code.google.com/p/vba-json/&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;I used the latter since it is Excel based VBA.&lt;/p&gt;
&lt;p&gt;Now, the function becomes&lt;/p&gt;
&lt;div style=&quot;overflow: auto; white-space: nowrap;&quot; class=&quot;codecolorer-container text default&quot;&gt;&lt;div style=&quot;white-space: nowrap;&quot; class=&quot;text codecolorer&quot;&gt;Public Function DetectLanguage(sInput As String, Optional dConfidence As Double = 0.25) As String&lt;br&gt;
&#160; &#160; &lt;br&gt;
&#160; &#160; Dim clsLanguage As New cLanguage&lt;br&gt;
&#160; &#160; With clsLanguage&lt;br&gt;
&#160; &#160; .InputText = sInput&lt;br&gt;
&#160; &#160;&lt;br&gt;
&#160; &#160; DetectLanguage = IIf(.Confidence &gt; dConfidence, .LanguageCode, &quot;unknown&quot;)&lt;br&gt;
&#160; &#160; &#160; &#160; End With&lt;br&gt;
&#160; &#160; End Function&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;In the cLanguage class, modify:&lt;/p&gt;
&lt;div style=&quot;overflow: auto; white-space: nowrap;&quot; class=&quot;codecolorer-container text default&quot;&gt;&lt;div style=&quot;white-space: nowrap;&quot; class=&quot;text codecolorer&quot;&gt;Private msInputText As String, ResponseText As String, ResponseObj&lt;/div&gt;&lt;/div&gt;
&lt;div style=&quot;overflow: auto; white-space: nowrap;&quot; class=&quot;codecolorer-container text default&quot;&gt;&lt;div style=&quot;white-space: nowrap;&quot; class=&quot;text codecolorer&quot;&gt;&#160; &#160; If oHttp.Status = 200 Then&lt;br&gt;
&#160; &#160; &#160; &#160; ResponseText = oHttp.ResponseText&lt;br&gt;
&#160; &#160; &#160; &#160; Dim X As JSONLib: Set X = New JSONLib&lt;br&gt;
&#160; &#160; &#160; &#160; Set ResponseObj = X.parse(&quot;[&quot; &amp; ResponseText &amp; &quot;]&quot;)&lt;br&gt;
&#160; &#160; End If&lt;/div&gt;&lt;/div&gt;
&lt;div style=&quot;overflow: auto; white-space: nowrap;&quot; class=&quot;codecolorer-container text default&quot;&gt;&lt;div style=&quot;white-space: nowrap;&quot; class=&quot;text codecolorer&quot;&gt;Public Property Get Confidence() As Double&lt;br&gt;
&#160; &#160; Confidence = ResponseObj(1)(&quot;responseData&quot;)(&quot;confidence&quot;)&lt;br&gt;
&#160; &#160; End Property&lt;br&gt;
Public Property Get LanguageCode() As String&lt;br&gt;
&#160; &#160; LanguageCode = ResponseObj(1)(&quot;responseData&quot;)(&quot;language&quot;)&lt;br&gt;
&#160; &#160; End Property&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;and the code to use DetectLanguage&lt;/p&gt;
&lt;div style=&quot;overflow: auto; white-space: nowrap;&quot; class=&quot;codecolorer-container text default&quot;&gt;&lt;div style=&quot;white-space: nowrap;&quot; class=&quot;text codecolorer&quot;&gt;Sub testDetectLang()&lt;br&gt;
&#160; &#160; MsgBox DetectLanguage(&quot;this is one language&quot;) _&lt;br&gt;
&#160; &#160; &#160; &#160; &amp; &quot;,&quot; &amp; DetectLanguage(&quot;ich bien ein berliner&quot;) _&lt;br&gt;
&#160; &#160; &#160; &#160; &amp; &quot;,&quot; &amp; DetectLanguage(&quot;esta es una segunda lengua&quot;) _&lt;br&gt;
&#160; &#160; &#160; &#160; &amp; &quot;,&quot; &amp; DetectLanguage(&quot;eto mae hyn yn iaith arall&quot;) _&lt;br&gt;
&#160; &#160; &#160; &#160; &amp; &quot;,&quot; &amp; DetectLanguage(&quot;Bu baska bir dildir&quot;, 0) _&lt;br&gt;
&#160; &#160; &#160; &#160; &amp; &quot;,&quot; &amp; DetectLanguage(&quot;Dit is nog &#039;n ander taal&quot;)&lt;br&gt;
&#160; &#160; &#160; &#160; &#039;Welsh is reported as en, Afrikaans is reported as nl, _&lt;br&gt;
&#160; &#160; &#160; &#160; &#160;tr confidence is lower than the default, don&#039;t know what it is but I used 0&lt;br&gt;
&#160; &#160; End Sub&lt;/div&gt;&lt;/div&gt;
</description>
		<content:encoded><![CDATA[<p>Hi Dick:</p>
<p>The Google response is in JSON.  Rather than parse the result yourself, get one <a href="http://www.ediy.co.nz/vbjson-json-parser-library-in-vb6-xidc55680.html" rel="nofollow">http://www.ediy.co.nz/vbjson-json-parser-library-in-vb6-xidc55680.html</a> or <a href="http://code.google.com/p/vba-json/" rel="nofollow">http://code.google.com/p/vba-json/</a></p>
<p>I used the latter since it is Excel based VBA.</p>
<p>Now, the function becomes</p>
<div style="overflow: auto; white-space: nowrap;" class="codecolorer-container text default">
<div style="white-space: nowrap;" class="text codecolorer">Public Function DetectLanguage(sInput As String, Optional dConfidence As Double = 0.25) As String<br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; Dim clsLanguage As New cLanguage<br />
&nbsp; &nbsp; With clsLanguage<br />
&nbsp; &nbsp; .InputText = sInput<br />
&nbsp; &nbsp;<br />
&nbsp; &nbsp; DetectLanguage = IIf(.Confidence &gt; dConfidence, .LanguageCode, &#8220;unknown&#8221;)<br />
&nbsp; &nbsp; &nbsp; &nbsp; End With<br />
&nbsp; &nbsp; End Function</div>
</div>
<p>In the cLanguage class, modify:</p>
<div style="overflow: auto; white-space: nowrap;" class="codecolorer-container text default">
<div style="white-space: nowrap;" class="text codecolorer">Private msInputText As String, ResponseText As String, ResponseObj</div>
</div>
<div style="overflow: auto; white-space: nowrap;" class="codecolorer-container text default">
<div style="white-space: nowrap;" class="text codecolorer">&nbsp; &nbsp; If oHttp.Status = 200 Then<br />
&nbsp; &nbsp; &nbsp; &nbsp; ResponseText = oHttp.ResponseText<br />
&nbsp; &nbsp; &nbsp; &nbsp; Dim X As JSONLib: Set X = New JSONLib<br />
&nbsp; &nbsp; &nbsp; &nbsp; Set ResponseObj = X.parse(&#8220;[" &amp; ResponseText &amp; "]&#8220;)<br />
&nbsp; &nbsp; End If</div>
</div>
<div style="overflow: auto; white-space: nowrap;" class="codecolorer-container text default">
<div style="white-space: nowrap;" class="text codecolorer">Public Property Get Confidence() As Double<br />
&nbsp; &nbsp; Confidence = ResponseObj(1)(&#8220;responseData&#8221;)(&#8220;confidence&#8221;)<br />
&nbsp; &nbsp; End Property<br />
Public Property Get LanguageCode() As String<br />
&nbsp; &nbsp; LanguageCode = ResponseObj(1)(&#8220;responseData&#8221;)(&#8220;language&#8221;)<br />
&nbsp; &nbsp; End Property</div>
</div>
<p>and the code to use DetectLanguage</p>
<div style="overflow: auto; white-space: nowrap;" class="codecolorer-container text default">
<div style="white-space: nowrap;" class="text codecolorer">Sub testDetectLang()<br />
&nbsp; &nbsp; MsgBox DetectLanguage(&#8220;this is one language&#8221;) _<br />
&nbsp; &nbsp; &nbsp; &nbsp; &amp; &#8220;,&#8221; &amp; DetectLanguage(&#8220;ich bien ein berliner&#8221;) _<br />
&nbsp; &nbsp; &nbsp; &nbsp; &amp; &#8220;,&#8221; &amp; DetectLanguage(&#8220;esta es una segunda lengua&#8221;) _<br />
&nbsp; &nbsp; &nbsp; &nbsp; &amp; &#8220;,&#8221; &amp; DetectLanguage(&#8220;eto mae hyn yn iaith arall&#8221;) _<br />
&nbsp; &nbsp; &nbsp; &nbsp; &amp; &#8220;,&#8221; &amp; DetectLanguage(&#8220;Bu baska bir dildir&#8221;, 0) _<br />
&nbsp; &nbsp; &nbsp; &nbsp; &amp; &#8220;,&#8221; &amp; DetectLanguage(&#8220;Dit is nog &#8216;n ander taal&#8221;)<br />
&nbsp; &nbsp; &nbsp; &nbsp; &#8216;Welsh is reported as en, Afrikaans is reported as nl, _<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;tr confidence is lower than the default, don&#8217;t know what it is but I used 0<br />
&nbsp; &nbsp; End Sub</div>
</div>
]]></content:encoded>
	</item>
	<item>
		<title>By: eyeIT</title>
		<link>http://www.dailydoseofexcel.com/archives/2010/03/15/language-detection/#comment-44586</link>
		<dc:creator>eyeIT</dc:creator>
		<pubDate>Mon, 15 Mar 2010 20:54:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.dailydoseofexcel.com/?p=3699#comment-44586</guid>
		<description>&lt;p&gt;Indeed, we Swiss people do have 4 official national languages and it includes Rumantsch.&lt;/p&gt;
&lt;p&gt;Another way crossed my mind, but it perhaps fulfills not quite the task that was asked for. I would simply retrieve this information by &lt;/p&gt;
&lt;p&gt;Application.LanguageSettings.LanguageID(msoLanguageIDUI) &lt;/p&gt;
&lt;p&gt;This way, you would get the language used. Of course, it is not a detection which you could guess a language independently from the used system (that&#039;s maybe what was asked for).&lt;/p&gt;
&lt;p&gt;Anyway, it&#039;s a very interesting solution you suggested.&lt;/p&gt;
&lt;p&gt;By the way, can anyone explain me what reason you could have to use Python for Excel?&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>Indeed, we Swiss people do have 4 official national languages and it includes Rumantsch.</p>
<p>Another way crossed my mind, but it perhaps fulfills not quite the task that was asked for. I would simply retrieve this information by </p>
<p>Application.LanguageSettings.LanguageID(msoLanguageIDUI) </p>
<p>This way, you would get the language used. Of course, it is not a detection which you could guess a language independently from the used system (that&#8217;s maybe what was asked for).</p>
<p>Anyway, it&#8217;s a very interesting solution you suggested.</p>
<p>By the way, can anyone explain me what reason you could have to use Python for Excel?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Dick Kusleika</title>
		<link>http://www.dailydoseofexcel.com/archives/2010/03/15/language-detection/#comment-44579</link>
		<dc:creator>Dick Kusleika</dc:creator>
		<pubDate>Mon, 15 Mar 2010 19:51:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.dailydoseofexcel.com/?p=3699#comment-44579</guid>
		<description>&lt;p&gt;I read an rss feed from WordPress.com for any post that contains the word &#039;Excel&#039;.  It gets tons of foreign language blogs since Excel is the same in every language.  So I run them through an rss filter that filters out based on one word.  I just find a word in the post that couldn&#039;t possibly appear in English and use that in my filter.  It&#039;s the complement to what we&#039;re doing here; excluding rather than including languages.  But I think it supports what fzz says; it won&#039;t take many carefully chosen words to identify a language provided the input is long enough.&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>I read an rss feed from WordPress.com for any post that contains the word &#8216;Excel&#8217;.  It gets tons of foreign language blogs since Excel is the same in every language.  So I run them through an rss filter that filters out based on one word.  I just find a word in the post that couldn&#8217;t possibly appear in English and use that in my filter.  It&#8217;s the complement to what we&#8217;re doing here; excluding rather than including languages.  But I think it supports what fzz says; it won&#8217;t take many carefully chosen words to identify a language provided the input is long enough.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: fzz</title>
		<link>http://www.dailydoseofexcel.com/archives/2010/03/15/language-detection/#comment-44578</link>
		<dc:creator>fzz</dc:creator>
		<pubDate>Mon, 15 Mar 2010 19:01:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.dailydoseofexcel.com/?p=3699#comment-44578</guid>
		<description>&lt;p&gt;I&#039;d figure the present tense forms of the verbs to be and to have along with the pronouns would be sufficient to identify any German or Latin root language. For that matter, I&#039;d figure the frequency of the German articles der and das alone would be sufficient to identify German from either French or Italian. Then the frequency of French plural definite article les and the cojunction et should be sufficient to identify French from Italian.&lt;/p&gt;
&lt;p&gt;IOW, I&#039;d be willing to bet the following would be sufficient in any noncontrived text of 50 words or more.&lt;/p&gt;
&lt;p&gt;German    der, das, ein, und, oder&lt;br&gt;
French    les, un, et, ou&lt;/p&gt;
&lt;p&gt;Tangent: I thought Rumantsch was still also a national language.&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>I&#8217;d figure the present tense forms of the verbs to be and to have along with the pronouns would be sufficient to identify any German or Latin root language. For that matter, I&#8217;d figure the frequency of the German articles der and das alone would be sufficient to identify German from either French or Italian. Then the frequency of French plural definite article les and the cojunction et should be sufficient to identify French from Italian.</p>
<p>IOW, I&#8217;d be willing to bet the following would be sufficient in any noncontrived text of 50 words or more.</p>
<p>German    der, das, ein, und, oder<br />
French    les, un, et, ou</p>
<p>Tangent: I thought Rumantsch was still also a national language.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: mt</title>
		<link>http://www.dailydoseofexcel.com/archives/2010/03/15/language-detection/#comment-44575</link>
		<dc:creator>mt</dc:creator>
		<pubDate>Mon, 15 Mar 2010 15:17:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.dailydoseofexcel.com/?p=3699#comment-44575</guid>
		<description>&lt;p&gt;Related to this, here&#039;s a function for translating text via the Google Translate API:  &lt;a href=&quot;http://mikaelspage.blogspot.com/2009/09/excel-function-for-translating-text.html&quot; rel=&quot;nofollow&quot;&gt;http://mikaelspage.blogspot.com/2009/09/excel-function-for-translating-text.html&lt;/a&gt;&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>Related to this, here&#8217;s a function for translating text via the Google Translate API:  <a href="http://mikaelspage.blogspot.com/2009/09/excel-function-for-translating-text.html" rel="nofollow">http://mikaelspage.blogspot.com/2009/09/excel-function-for-translating-text.html</a></p>
]]></content:encoded>
	</item>
</channel>
</rss>

