Wednesday, January 17, 2007

Queen and Country

Can Sonnet detect the difference between en_US and en_GB? No, and yes. I've been asked that quite a bit, so I'll clarify. There are several key requirements, as I see them, for adding language detection to KDE.

  1. It must distinguish between different languages. While all supported languages could be detected, it is more likely that a user will only use a few languages in most of his sessions or that the program will be used by in setting by people speaking a specific range of languages. For example, a speaker of French and German, or school computer lab with speakers of Xhosa, Zulu and Afrikaans.
  2. It must be Fast. The detection must occur in real-time; otherwise, the user might as well select their language manually.
I've optimized the language detection for the above criteria. The models used are limited so that they are fast. This makes detection less accurate, but this is overcome, by taking into account other factors such default settings or the language detected for surrounding text segments.

Are users of multiple dialects less important? No, but if I value priorities (1) and (2) above, then the detection of the dialect will be highly inaccurate due to the nature of the algorithms used. However, detecting a sample of text written in a dialect as the common language currently is robust. It must be, the detection would be useless for our purposes if it were so brittle as to fail on minor spelling differences, which are likely candidates for errors. Additionally the statistical differences between dialects are much less then between different languages. In most cases, text in a different dialect just isn't contrastive enough in the greater scheme of things.

Now, there are ways to distinguish between American and British spellings, but doing it at the statistical comparison stage isn't reliable with the current heuristics used, but could be done if there was enough user demand. However, any application that utilizes the languages guessing class should be a bit smarter. The convenience classes Sonnet will provide will distinguish between countries by checking user settings. If the users locale is de_BE and French is detected then the spell checker would default to checking with fr_BE; it would fallback to fr or fr_FR if a dictionary for fr_BE was not found.

In summary, the language detection class will not distinguish between cases where the same language has a different orthography in a different country. Yet, tools built using this class will distinguish between them using alternative means. But, I could be wrong in my assumptions. If enough complaints surface, it's early enough to change the behavior.

For all those who emailed me questions similar to ris:
[08:28] <ris> rideout: re: sonnet test sentences - would it be useful to put a british english test sentence in? would sonnet be able to distinguish between the two if you stuck a few 'realise', 'centre' and 'programme's in?
It is very reasonable to test that British English is detected as English. Empirically, Sonnet is not encumbered by the mild differences that exist between British and American orthography.

EDIT: I meant to ask this originally, but became carried away and forgot. Are there languages for which I must distinguish between dialects? I can think of examples like Chinese where the dialects are essentially different languages. But, in this case they all share a common orthography. Are there those with different orthographies?

NOTE: In this post, I did conflate the notion of dialects and countries with different standards of orthography. To the pedantic, please don't shoot. To the curious, I try to limit the use of technical linguistic terms in this blog and to use the imprecise and ofter confused vernacular, this has led to some confusion in the past.

17 comments:

henrique said...

I just hope that one can manually "exclude" a language from the search list, or make a rule like "whenever Portuguese is detected, assume Brazilian Portuguese". Brazilian Portuguese and the Portuguese spoken in the rest of the world are pretty much different languages nowadays, to the point that, e.g., when TV programs from Portugal are shown here, they're dubbed (or have subtitles). Given that the population of Brazil is around 180 million, and that KDE has many users in Brazil, I think a way to detect pt_BR is needed, even if it's only a configuration setting assuming pt_BR instead of pt by default.

Jacob Rideout said...

henrique: a comment on previous post by caio1982 on this issue prompted me to write this post. Yes there will be a setting allowing you to set the default country for a language. So, the question is: are the differences between written (not spoken) Portuguese and Brazilian Portuguese different enough that I need a model of each language. Or are the differences minor, like those between written dialects of English?

There are a few directions to go from here. (1) keep everything as is, Brazilian users will set pt_BR as the default for pt. (2) Have the language detection return a five letter string like xx_XX when in every case it can. This will slow language detection. (3) return xx_XX only in rare cases where it is not just helpful, but necessary.

Hank Miller said...

Thank you. I've always wanted something like this, but never had a clue on how to go about doing it.

henrique said...

The grammar is pretty much the same for both languages, but vocabulary is much different, radically different in some areas.
As a native pt_BR speaker, it is difficult, but not impossible, for me to understand pt_PT. I don't know if the differences are enough for you to need a model of each of them, but surely the difference is orders of magnitude greater than the difference between dialects of English.

I can do a comparison of the pt_BR and pt_PT translations of KDE for you if that would be of any help. You can contact me via the e-mail address "henrique.pinto@kdemail.net".

medicine said...

Home
FAQ
Contact Us
Newsletter
Refer A Friend
Shipping Terms
Terms of Use
A
B
C
D
E
F
G
H
I
K
L
M
N
O
P
R
S
T
V
W
X
Z
allergies
Allegra
Astelin
Atrovent
Clarinex
Claritin
Periactin
Zyrtec
anti depressants
anafranil
Celexa
Desyrel
Dilantin
Effexor
Elavil
Fludac
Lexapro
Luvox
Nortriptyline
Pamelor
Paxil
Risperdal
Wellbutrin
anti fungal
nizoral
anti viral
Combivir
Epivir
Rebetol
Symmetrel
Viramune
antibiotics
Augmentin
Bactrim
Biaxin
Cefaclor
Cipro
Cleocin
Doxycycline
Duricef
Erythromycin (PCE)
Floxin
Ilosone
Keflex
Levaquin
Minomycin
Myambutol
Rulide
Sumycin
Zithromax
anticonvulsant
Neurontin
Topamax
antidiabetic
Actos
Amaryl
Avandia
Glucophage
Glucotrol
Prandin
anxiety
Atarax
Buspar
arthritis
Alfacip
Allopurinol (Zyloprim)
Ansaid
Arava
Arcoxia
Mobic
Relafen
All products
Albuterol
Singulair
Ventorlin
birth control
Alesse
Desogen
Levlen
Ortho Tri-Cyclen
Ovral
blood pressure
Adalat
Aldactone
Alphagan 2%
Altace
Avapro
Capoten
Cardura
Combipres
Coreg
Coversyl
Cozaar
Diovan
Frumil
Hytrin
Hyzaar
Inderal
Lopressor
Lotensin
Lotrel
Lozol
Microzide
Minipress
Norvasc
Plendil
Vasotec
Zebeta
Zestril
Alkeran
Cytoxan
Hydrea
Methotrexate
Nolvadex
cardiovascular
Cardarone
Cardizem
Cardizem HCI
Coumadin
Lanoxin
Mextil
Tenormin
cholesterol
Mevacor
Pravachol
Zocor
diuretics
Furosemide
Pilagan 2%
Pilagan 4%
gastrointestinal
Aciphex
Carafate
Colospa
Duphalac
Imodium
Nexium
Pepcid
Prevacid
Prilosec
Protonix
Reglan
Zantac
headache
Depakote
Imitrex
heart rates
Verapamil
herbals
36 Beauty
Ashwafera
EnMobil Cream
Heart Shield
Herbal Viagra
Mega Hoodia
Nutriloe
Ortholife
Penisole
hormones
Mestinon
Synthroid
men's health
Avodart
Casodex
Cialis
Cialis Professional
Cialis Soft Tabs
Cialis Super Active
ED Discount Pack #1
ED Discount Pack #2
ED Discount Pack #3
ED Trial Pack
Eulexin
Levitra
Lipitor
Propecia
Proscar
Sildenafil (Caverta)
Sildenafil (Kamagra)
Super ED Trial Pack
Tadanafil SX (Tadanafil)
Viagra
Viagra Oral Jelly
Viagra Professional
Viagra Soft Tabs
Viagra Super Active
motion sickness
Dramamine
muscle relaxant
Lioresal
medicine
Asacol
DDAVP 2.5ml
Diamox
Ditropan
Eldepryl
Exelon
Imuran
Nimotop
Persantine
Rogaine 2%
Rogaine 5%
pain relief
Celecoxib
Deltasone
Emulgel
Feldene
Imdur
Indocin
Isosorbide Mononitrate
Motrin
Paracetamol
Ponstel
Voltarol
sexual health
Famvir
Valtrex
skin care
Accutane
Bactroban 2%
Benzac 2.5%
Benzac 5%
Dapsone
stop smoking
Zyban
weight loss
Acomplia (Zimulti)
Florinef
Xenical
women's health
Aygestin
Clomid (Serophene)
Diflucan
Duphaston
Estrace
Evista
Female Viagra
Fosamax
Gestanin
Naprosyn
Parlodel
Premarin
Provera

doctor said...

Home
FAQ
Contact Us
Newsletter
Refer A Friend
Shipping Terms
Terms of Use
A
B
C
D
E
F
G
H
I
K
L
M
N
O
P
R
S
T
V
W
X
Z
allergies
Allegra
Astelin
Atrovent
Clarinex
Claritin
Periactin
Zyrtec
anti depressants
anafranil
Celexa
Desyrel
Dilantin
Effexor
Elavil
Fludac
Lexapro
Luvox
Nortriptyline
Pamelor
Paxil
Risperdal
Wellbutrin
anti fungal
nizoral
anti viral
Combivir
Epivir
Rebetol
Symmetrel
Viramune
antibiotics
Augmentin
Bactrim
Biaxin
Cefaclor
Cipro
Cleocin
Doxycycline
Duricef
Erythromycin (PCE)
Floxin
Ilosone
Keflex
Levaquin
Minomycin
Myambutol
Rulide
Sumycin
Zithromax
anticonvulsant
Neurontin
Topamax
antidiabetic
Actos
Amaryl
Avandia
Glucophage
Glucotrol
Prandin
anxiety
Atarax
Buspar
arthritis
Alfacip
Allopurinol (Zyloprim)
Ansaid
Arava
Arcoxia
Mobic
Relafen
All products
Albuterol
Singulair
Ventorlin
birth control
Alesse
Desogen
Levlen
Ortho Tri-Cyclen
Ovral
blood pressure
Adalat
Aldactone
Alphagan 2%
Altace
Avapro
Capoten
Cardura
Combipres
Coreg
Coversyl
Cozaar
Diovan
Frumil
Hytrin
Hyzaar
Inderal
Lopressor
Lotensin
Lotrel
Lozol
Microzide
Minipress
Norvasc
Plendil
Vasotec
Zebeta
Zestril
Alkeran
Cytoxan
Hydrea
Methotrexate
Nolvadex
cardiovascular
Cardarone
Cardizem
Cardizem HCI
Coumadin
Lanoxin
Mextil
Tenormin
cholesterol
Mevacor
Pravachol
Zocor
diuretics
Furosemide
Pilagan 2%
Pilagan 4%
gastrointestinal
Aciphex
Carafate
Colospa
Duphalac
Imodium
Nexium
Pepcid
Prevacid
Prilosec
Protonix
Reglan
Zantac
headache
Depakote
Imitrex
heart rates
Verapamil
herbals
36 Beauty
Ashwafera
EnMobil Cream
Heart Shield
Herbal Viagra
Mega Hoodia
Nutriloe
Ortholife
Penisole
hormones
Mestinon
Synthroid
men's health
Avodart
Casodex
Cialis
Cialis Professional
Cialis Soft Tabs
Cialis Super Active
ED Discount Pack #1
ED Discount Pack #2
ED Discount Pack #3
ED Trial Pack
Eulexin
Levitra
Lipitor
Propecia
Proscar
Sildenafil (Caverta)
Sildenafil (Kamagra)
Super ED Trial Pack
Tadanafil SX (Tadanafil)
Viagra
Viagra Oral Jelly
Viagra Professional
Viagra Soft Tabs
Viagra Super Active
motion sickness
Dramamine
muscle relaxant
Lioresal
medicine
Asacol
DDAVP 2.5ml
Diamox
Ditropan
Eldepryl
Exelon
Imuran
Nimotop
Persantine
Rogaine 2%
Rogaine 5%
pain relief
Celecoxib
Deltasone
Emulgel
Feldene
Imdur
Indocin
Isosorbide Mononitrate
Motrin
Paracetamol
Ponstel
Voltarol
sexual health
Famvir
Valtrex
skin care
Accutane
Bactroban 2%
Benzac 2.5%
Benzac 5%
Dapsone
stop smoking
Zyban
weight loss
Acomplia (Zimulti)
Florinef
Xenical
women's health
Aygestin
Clomid (Serophene)
Diflucan
Duphaston
Estrace
Evista
Female Viagra
Fosamax
Gestanin
Naprosyn
Parlodel
Premarin
Provera

Anonymous said...

看房子,買房子,建商自售,自售,台北新成屋,台北豪宅,新成屋,豪宅,美髮儀器,美髮,儀器,髮型,EMBA,MBA,學位,EMBA,專業認證,認證課程,博士學位,DBA,PHD,在職進修,碩士學位,推廣教育,DBA,進修課程,碩士學位,網路廣告,關鍵字廣告,關鍵字,課程介紹,學分班,文憑,牛樟芝,段木,牛樟菇,日式料理, 台北居酒屋,日本料理,結婚,婚宴場地,推車飲茶,港式點心,尾牙春酒,台北住宿,國內訂房,台北HOTEL,台北婚宴,飯店優惠,台北結婚,婚宴場地,推車飲茶,港式點心,尾牙春酒,住宿,訂房,HOTEL,飯店,造型系列,學位,牛樟芝,腦磷脂,磷脂絲胺酸,SEO,婚宴,捷運,學區,美髮,儀器,髮型,牛樟芝,腦磷脂,磷脂絲胺酸,看房子,買房子,建商自售,自售,房子,捷運,學區,台北新成屋,台北豪宅,新成屋,豪宅,學位,碩士學位,進修,在職進修, 課程,教育,學位,證照,mba,文憑,學分班,網路廣告,關鍵字廣告,關鍵字,SEO,关键词,网络广告,关键词广告,SEO,关键词,网络广告,关键词广告,SEO,台北住宿,國內訂房,台北HOTEL,台北婚宴,飯店優惠,住宿,訂房,HOTEL,飯店,婚宴,台北住宿,國內訂房,台北HOTEL,台北婚宴,飯店優惠,住宿,訂房,HOTEL,飯店,婚宴,台北住宿,國內訂房,台北HOTEL,台北婚宴,飯店優惠,住宿,訂房,HOTEL,飯店,婚宴,結婚,婚宴場地,推車飲茶,港式點心,尾牙春酒,台北結婚,婚宴場地,推車飲茶,港式點心,尾牙春酒,結婚,婚宴場地,推車飲茶,港式點心,尾牙春酒,台北結婚,婚宴場地,推車飲茶,港式點心,尾牙春酒,結婚,婚宴場地,推車飲茶,港式點心,尾牙春酒,台北結婚,婚宴場地,推車飲茶,港式點心,尾牙春酒,居酒屋,燒烤,美髮,儀器,髮型,美髮,儀器,髮型,美髮,儀器,髮型,美髮,儀器,髮型,小套房,小套房,進修,在職進修,留學,證照,MBA,EMBA,留學,MBA,EMBA,留學,進修,在職進修,牛樟芝,段木,牛樟菇,關鍵字排名,網路行銷,关键词排名,网络营销,網路行銷,關鍵字排名,关键词排名,网络营销,PMP,在職專班,研究所在職專班,碩士在職專班,PMP,證照,在職專班,研究所在職專班,碩士在職專班,SEO,廣告,關鍵字,關鍵字排名,網路行銷,網頁設計,網站設計,網站排名,搜尋引擎,網路廣告,SEO,廣告,關鍵字,關鍵字排名,網路行銷,網頁設計,網站設計,網站排名,搜尋引擎,網路廣告,SEO,廣告,關鍵字,關鍵字排名,網路行銷,網頁設計,網站設計,網站排名,搜尋引擎,網路廣告,SEO,廣告,關鍵字,關鍵字排名,網路行銷,網頁設計,網站設計,網站排名,搜尋引擎,網路廣告,EMBA,MBA,PMP
,在職進修,專案管理,出國留學,EMBA,MBA,PMP
,在職進修,專案管理,出國留學,EMBA,MBA,PMP
,在職進修,專案管理,出國留學

住宿,民宿,飯宿,旅遊,住宿,民宿,飯宿,旅遊,住宿,民宿,飯宿,旅遊,住宿,民宿,飯宿,旅遊,住宿,民宿,飯宿,旅遊,住宿,民宿,飯宿,旅遊,住宿,民宿,飯宿,旅遊,美容,美髮,整形,造型,美容,美髮,整形,造型,美容,美髮,整形,造型,美容,美髮,整形,造型,美容,美髮,整形,造型,美容,美髮,整形,造型,美容,美髮,整形,造型,設計,室內設計,裝潢,房地產,設計,室內設計,裝潢,房地產,設計,室內設計,裝潢,房地產,設計,室內設計,裝潢,房地產,設計,室內設計,裝潢,房地產,設計,室內設計,裝潢,房地產,設計,室內設計,裝潢,房地產,設計,室內設計,裝潢,房地產,進修,在職進修,MBA,EMBA,進修,在職進修,MBA,EMBA,進修,在職進修,MBA,EMBA,進修,在職進修,MBA,EMBA,進修,在職進修,MBA,EMBA,進修,在職進修,MBA,EMBA,進修,在職進修,MBA,EMBA,住宿,民宿,飯店,旅遊,美容,美髮,整形,造型,設計,室內設計,裝潢,房地產,進修,在職進修,MBA,EMBA,羅志祥,周杰倫,五月天,蔡依林,林志玲,羅志祥,周杰倫,五月天,蔡依林,林志玲,羅志祥,周杰倫,五月天,蔡依林,羅志祥,周杰倫,五月天,蔡依林

Peter Jackson said...

Imitrex is prescribed for the treatment of a migraine attack with or without the presence of an aura (visual disturbances, usually sensations of halos or flickering lights, which precede an attack).

Buy Imitrex

Anonymous said...

.http://wvvv6.spaces.live.com
http://pumashoes2009.spaces.live.com
http://buy-cheap-ugg-boots.blogspot.com
http://www.eshooes.com/cheap-shoes-show
http://good-puma.blogspot.com/
.http://apps.facebook.com/faceblogged/?uid=1447786117

Peejay Li said...

I would like to be the supporter of yours. Thank you for sharing such a nice article.
chaussures puma
puma speed cat
Nike Tn Chaussures
requin tn
nike shox
puma shoes
puma CAT
puma basket
puma speed
baskets puma
puma sport
puma femmes
puma shox r4 torch
nike air max requin
nike shox r3
shox rival r3
tn plus
chaussures shox
nike shox r4 torch
air max tn requin
nike tn femme
pas cher nike
tn chaussures
nike rift
nike shox nz
chaussures shox
nike shox rival
shox rival
chaussures requin
jeans online
cheap armani jeans
cheap G-star jeans

Anonymous said...

酒店打工

酒店兼職

台北酒店

打工兼差

酒店工作

酒店經紀

禮服酒店

酒店兼差

酒店上班

酒店PT

酒店

酒店喝酒

酒店消費

喝花酒

粉味

喝酒

lucyliu said...

nike air max 90
nike air max 95
nike air max tn
nike air rift
nike shox r4
nike air max 360
nike shox nz
puma mens shoes
puma shoes
puma speed
nike shoes
nike air
nike air shoes
puma cat
air max trainers
mens nike air max
nike shoes air max
nike shoes shox
air shoes
nike shoe cart
puma future
cheap puma
sports shoes
nike air rifts
nike air rift trainer
nike air
nike rift
nike rift shoes
cheap nike air rifts
bape shoes
jeans shop
diesel jeans
levis jeans

Anonymous said...

I like your blog. Thank you. They are really great .
Some new style Puma Cat shoes is in fashion this year.
The Nike Air Shoes is a best Air Shoes .
Nike Air Rift is good and Cheap Nike Shoes.
If you are a fans of Puma basket,we would offer the good and Cheap Puma Shoes for you .the cheap ugg bootsis best christmas gift now.
The information age is really convenient .

LAN said...

puma mens shoes
puma shoes
puma speed
nike shoes
nike air
nike air shoes
nike air max 90
nike air max 95
nike air max tn
nike air rift
nike shox r4
nike air max 360
nike shox nz
puma cat
air max trainers
mens nike air max
sports shoes
nike air rifts
nike air rift trainer
nike air
nike shoes air max
nike shoes shox
air shoes
Lucyliu IS Lucyliu
nike shoe cart
puma future
cheap puma
nike rift
jeans shop
diesel jeans
levis jeans
nike rift shoes
cheap nike air rifts
bape shoes

ペアリング said...

ペアリングをつけた瞬間にペアリング 人気を選びだしたのだったが、プレゼントしようと思いペアリング ランキングペアリング ブランドのどちらがよいかとおもったが、ペアリング ブランドのほうがよいとかんじたので誕生日プレゼントは、あきらめようとしたその瞬間に ワイン 熟成 グッズ
をつけてまもなくした頃だったと思うのですが、ひとつ気づいたことが気になってしかたがなかった。しかし、そこへサマーバレンタインデーにもってこいだろう。さらに、Inner Messageもわすれないでもらいたい。それからまもなくしてFX ブログで金儲け。http://www.pairringselect.com/ ペアリング 人気

Anonymous said...

酒店打工 酒店兼職
台北酒店 打工兼差 酒店工作 禮服酒店
酒店兼差 酒店上班 酒店應徵 酒店 酒店經紀

ばいと said...

口コミで大人気の20代女性に人気 高収入アルバイトがいい感じ、役立つ学生・フリーターに人気の高収入メールレディーはとてもよろしいと思いました。すごい話すだけで稼げる携帯メールレディーがいい感じ、くちこみで評判の30代女性でも月40万以上稼げるだね^^稼ぐための参考サイトママさんでも月60万以上稼げるです。役立つ未経験でも稼げるチャットレディーがイイよ、人気サイト会話だけでも安全 チャットレディーがイイよ、マル秘情報満載40代女性に人気 高収入在宅バイトが1番良かったです!!役立つ通勤不要☆稼げる携帯メールレディがイイよ、マル秘情報満載30代女性に人気の高収入メールレディーを参考に凄い学生でも1日2万以上稼げるをクリック@役立つ子持ち主婦でも月30万以上稼げるで幸せな生活を取り戻しました。イイ情報がたくさんの専業主婦の高収入在宅仕事がいい感じ、皆さんにお勧めしたい彼に内緒で稼げる 在宅バイトを参考にしてみてね★稼ぐための参考サイトママさんに人気の携帯仕事ですよ!本物の空いた時間に稼げる携帯チャットレディは楽しいね。大人気30代女性 稼ぎやすい自宅バイト で幸せになれた○人気の女性に人気の携帯在宅バイトで貴重なサイトを知れて良かったです!★育児中の主婦でも1日5000円以上稼げるが1番良かったです!!某掲示板でも評判の彼氏に内緒で稼げる チャットレディーがイイよ、人気サイト夜間だけで稼げる携帯チャットレディーで貴重なサイトを知れて良かったです!