[chromium-dev] Re: Design Doc: Adaptive spell checking for multilingual users

2009-07-23 Thread sidchat

Thank you Brian and Paul for your comments and insights. Yes, the plan
is to expand to multi-spellcheck simultaneously when the user types in
some other language other than the default one, and avoid changing on
the fly too often.

Paul, I have this feature on hold right now to discuss more issues,
and also concentrate on spell check bugs, which need to be squashed
before more features (like this one) are crammed in. I have been
noticing that you have made some good contributions to spell checking
on OS X. If you want, and have time, feel free to grab some spell
check bugs and fix them (see
http://code.google.com/p/chromium/issues/list?can=2&q=sidchat%20status:Assigned%20owner:sidc...@chromium.org&sort=-modified&colspec=ID%20Stars%20Pri%20Area%20Type%20Status%20Summary%20Modified%20Owner).

Once we have the bugs in control, I will expand the functionality, and
you are welcome to port to OS X as appropriate.

Thanks,
Sid

On Jul 22, 10:48 pm, Brian Rakowski  wrote:
> I fear that this is treading into territory where the software is trying to
> be too smart. Most users will type in one language. Many users will type in
> two languages. Few users will type in more than two languages. A simpler
> design is simply to notice that the user seems to be multilingual and offer
> to expand spell check to the additional language(s). I'm concerned that
> frequent on-the-fly switches will result in incorrect flagging of misspelled
> words and will irritate users.
>
> -Brian
>
>
>
> On Mon, Jul 20, 2009 at 2:08 PM, Paul Wicks  wrote:
> > Another thing to consider is that something sort of like this is already
> > supported by the OS X spellchecker through the "Multilingual" language
> > setting. There is currently no way to switch to Multilingual in Chromium on
> > OS X, but it wouldn't be that hard to enable that and it really is something
> > that should be enabled if we want to support the native spelling correction
> > panel on OS X (something which I have about 2/3's done), since the spelling
> > panel shows Multilingual as a language option even if the context menu
> > doesn't. I've done a little bit of experimenting and Multilingual seems to
> > work pretty well in Chromium if you can enable it. One thing that might be a
> > problem is that as far as I can tell, the Multilingual setting just checks
> > all dictionaries for a word, so there could be problems there since a
> > misspelling in the language being used might not be marked if it is a word
> > in another language.
>
> > I don't think I can say whether chromium is willing to accept
> > "Multilingual" as the solution for this on OS X. If it is, then what you
> > propose needs to be done in such a way that it doesn't touch the way OS X
> > does this. If this is the solution for all platforms, OS X included, then we
> > need to figure out a way around the spelling panel problem (no matter what,
> > the spelling panel provided by NSSpellChecker will show Multilingual as an
> > option).
>
> > Whatever is decided, this definitely looks good for the other platforms. If
> > this does go forward, I could probably help out, if you need a hand.
>
> > -Paul Wicks
>
> > On Mon, Jul 20, 2009 at 1:00 PM, sidchat  wrote:
>
> >> A new feature to add to the SpellChecker would be its ability to adapt
> >> to the user's language of choice when typing in a text box. A design
> >> doc can be found at:
>
> >>http://sites.google.com/a/chromium.org/dev/developers/design-document...
>
> >> It will be great if you could go over it and provide suggestions/
> >> improvements, before I move ahead and start implementing this feature
> >> as an experiment.
>
> >> -Sid
--~--~-~--~~~---~--~~
Chromium Developers mailing list: chromium-dev@googlegroups.com 
View archives, change email options, or unsubscribe: 
http://groups.google.com/group/chromium-dev
-~--~~~~--~~--~--~---



[chromium-dev] Design Doc: Adaptive spell checking for multilingual users

2009-07-20 Thread sidchat

A new feature to add to the SpellChecker would be its ability to adapt
to the user's language of choice when typing in a text box. A design
doc can be found at:

http://sites.google.com/a/chromium.org/dev/developers/design-documents/advancedspellchecker

It will be great if you could go over it and provide suggestions/
improvements, before I move ahead and start implementing this feature
as an experiment.

-Sid
--~--~-~--~~~---~--~~
Chromium Developers mailing list: chromium-dev@googlegroups.com 
View archives, change email options, or unsubscribe: 
http://groups.google.com/group/chromium-dev
-~--~~~~--~~--~--~---



[chromium-dev] Re: Changing the language of the spellchecker?

2009-06-17 Thread sidchat

Yes, Evan is right. So, when you change a spellcheck language in the
Options menu (languages_page_view.cc), it changes a pref member
(prefs::kSpellCheckDictionary) value. This change is caught by the
Profile (ProfileImpl::Observe in profile.cc), which (re)initializes
the spellchecker with the new language. The pref member can also be
changed from the right-click context menu, as Evan pointed out (see
RenderViewContextMenu::ExecuteItemCommand() in
render_view_context_menu.cc).

So it seems implementing languages Options menu and context menu items
items for spellchecker might make this whole thing work automatically.

-Sid

On Jun 17, 4:02 pm, Evan Martin  wrote:
> Just a guess, but perhaps when you change languages a new Spellchecker
> object with the new language is constructed.
>
> I would expect the language-picking options haven't yet been
> implemented.  You can also switch languages via the right-click menu
> on a text area, but that may also be unimplemented.  It might be worth
> implementing those as a prereq for your current project.  :)
>
>
>
> On Wed, Jun 17, 2009 at 3:54 PM, pwicks wrote:
>
> > I'm working on porting the os x spellchecker to chromium and I've run
> > into a question. I'm trying to figure out how the language of the
> > spellchecker is change. The only place that I can see where it is ever
> > specified is in the constructor to Spellchecker. I don't see any other
> > functions/methods that deal with language selection, just with
> > querying the available languages. I was going to try and trace this
> > through in the debugger, but the button on the options pane to change
> > the language is greyed out. Anybody know anything about how this works
> > or can point me in the right direction? (Sid, is this what you were
> > talking about when you mentioned that there was something
> > unimplemented?)
>
> > Thanks,
>
> > --Paul Wicks
--~--~-~--~~~---~--~~
Chromium Developers mailing list: chromium-dev@googlegroups.com 
View archives, change email options, or unsubscribe: 
http://groups.google.com/group/chromium-dev
-~--~~~~--~~--~--~---



[chromium-dev] Re: Adding Mac OS X Spellchecker to Chromium

2009-06-11 Thread sidchat

Use of OS X spellchecker integration in our multi process model
probably should be the primary goal here to begin with. If that is
achieved, the other stuff (auto spell correct, automatically setting
the dictionary etc) should not be too problematic.

Note that the actual replacement for auto-correct is done in WebCore
(WebKit) - Chrome just provides the decision as to whether to auto-
correct it or not. So, as you pointed out, our method SpellcheckWord,
instead of using Hunspell, can ask OS X SpellCheck API to provide the
decision. The multi-process model is automatically taken care of here
from existing design, since any query for spellchecking comes to the
spellchecker in the browser process - and the browser process can talk
to the OS X API I guess. Same goes for generic spell checking.

There is some integration with Chrome UI where one can set the
spellcheck dictionary languages, enable/disable spellchecking/auto-
correct. Again, all these decisions eventually seep down to the
spellchecker residing in the browser process, and as far as you are
concerned, the SpellCheckWord and GetAutoCorrectWord methods should
continue asking OS X for the spelling decisions, now based on the new
language, or not, depending on the setting.

If OS X does not support some languages, this can be dealt with
easily. You can make a list of languages that OS X supports, and based
on that, either ask OS X spellcheck API, or simply initialize Hunspell
in SpellChecker when the language is changed. The Profile, which
initializes spellchecker, can be blissfully unaware of this, as it
does not care how you are providing the spellchecking as long as the
spellchecker object exists, and is providing decisions.

I am not exactly sure how automatically setting dictionary language
will work out, as it has not been implemented yet. But you can get to
that later - my thought is, it should be on similar lines, where you
have to only worry about spellchecker.cc.

-Sid


On Jun 10, 8:29 pm, "Ben Goodger (Google)"  wrote:
> +Sid
>
> I think it's worth understanding the API requirements of the new
> features. I know nothing about Spellchecking though. Maybe Sid can add
> more?
>
> -Ben
>
>
>
> On Wed, Jun 10, 2009 at 8:14 PM, Nick Baum wrote:
> > In particular, Ben is referring to the automatic spelling correction that
> > Sid is implementing.
> > Off the top of my head, I can think of a few different ways this could fit
> > in:
>
> > We can implement Sid's auto-correction on top of native spellcheck, just
> > like today it's implemented on top of Hunspell.
> > OS X will provide similar (though not identical) functionality, and we deem
> > this good enough.
> > We decide native integration is more important than feature parity. As we
> > add more smarts to the spellchecker, we'd need to keep re-evaluating.
>
> > Thoughts?
> > -Nick
>
> > On Wed, Jun 10, 2009 at 2:38 PM, Ben Goodger (Google) 
> > wrote:
>
> >> For whoever is coordinating this effort, please sync up with Nick Baum
> >> on spell checking. He has some additional considerations in mind we
> >> should make sure we understand what's possible here.
>
> >> -Ben
>
> >> On Wed, Jun 10, 2009 at 2:36 PM, Mike Pinkerton
> >> wrote:
>
> >> > I think we're all on the same page. I pushed Paul to consider having
> >> > both in his initial design since I forgot about the ability to add
> >> > additional dictionaries. I'm glad others are in support of that as the
> >> > way to get additional language support as opposed to trying to shim
> >> > both implementations together.
>
> >> > I agree with Jeremy, let's focus on the OSX spellchecker and ignore
> >> > hunspell for now. Additionally, let's aim for the OS X spelling dialog
> >> > if we can do it, regardless of whether or not win/linux can do it.
>
> >> > On Wed, Jun 10, 2009 at 11:59 AM, Thomas Van
> >> > Lenten wrote:
>
> >> >> On Wed, Jun 10, 2009 at 2:38 PM, p_W  wrote:
>
> >> >>> Forgive my (possibly) stupid concern here, but a few months ago there
> >> >>> was some talk about this, and about how integrating with the OS's
> >> >>> spellchecker was the preferred route as it allowed users to use their
> >> >>> dictionary customizations over all their applications.  Here is link
> >> >>> to the discussion:
>
> >> >>>http://groups.google.com/group/chromium-dev/browse_thread/thread/3183...
>
> >> >>> Any thoughts about this?
>
> >> >> Uh, that's what this thread is about, his project is to switch to using
> >> >> the
> >> >> os one instead.  And Jeremy was commenting that he doesn't need to
> >> >> support
> >> >> both, just switch to the native.  Or am I reading this differently?
> >> >> TVL
>
> >> >>> On Jun 9, 9:00 pm, Jeremy Moskovich  wrote:
> >> >>> > A couple more things:
>
> >> >>> > * I think ultimately we should support the grammar checker, but at
> >> >>> > first
> >> >>> > just getting spellchecking to work would be great!
> >> >>> > * +1 for supporting the Cocoa gui for spellchecking paragraphs, see
> >> >>> > the
> >> >>> > 2nd
>

[chromium-dev] Re: An Introduction and a question

2009-06-01 Thread sidchat

The Editor in WebCore (Editor.cpp), which is a part of WebKit, asks
for the spelling of a word in line 1474. The spelling-check is
provided by us (Chromium) through the "glue" - in particular,
editor_client_impl.cc in method checkSpellingOfString. Now, this guy
uses a WebViewDelegate object to send message through the IPC to the
spellchecker residing in the browser process through
RenderView::SpellCheck (render_view.cc). This message is picked by
resource_message_filter.cc, which uses the function OnSpellCheck to
now formally ask the spellchecker object to tell it if the spelling is
right or wrong. As you pointed out, this has to be done in the IO
thread. Once it gets the answer, it sends a message back through IPC -
WebCore gets the answer, the editor is happy, and now you see an
underline.

This is the basic path, but you are most welcome to ping me, or drop
by my desk for questions/ideas. Also, Brett (brettw) is the guru of
this architecture, so you should definitely pass by him too for ideas.

-Sid

On May 30, 9:55 am, Evan Martin  wrote:
> From a quick glance, it appears that grepping the code for all
> instances of the word "spell" turns up all the related files with only
> a couple of unrelated bits.  In particular, for IPC stuff the files
> all have "render" in their name:
>
> $ git grep -l spell -- '*render*.cc' '*render*.h'
> chrome/browser/renderer_host/browser_render_process_host.cc
> chrome/browser/renderer_host/render_process_host.h
> chrome/browser/renderer_host/resource_message_filter.cc
> chrome/browser/renderer_host/resource_message_filter.h
> chrome/browser/tab_contents/render_view_context_menu.cc
> chrome/common/render_messages.h
> chrome/common/render_messages_internal.h
> chrome/renderer/render_view.cc
> chrome/renderer/render_view.h
>
>
>
> On Thu, May 28, 2009 at 1:55 PM, Paul Wicks  wrote:
> > Hello Chromium Developers!
>
> > My name is Paul Wicks and I am one of the students working for this project
> > as part of Google's Summer of Code (Mike Pinkerton is my mentor).
> > Specifically, I am working on implementing support for the OSX
> > dictionary/spellchecker in Chromium. There is a blog of my progress at
> >http://pwicks-bloggingchrome.blogspot.com/,although there really isn't any
> > content at the moment. Just thought I'd introduce myself.
>
> > Well, know that I have your attention, I do have one question. I've been
> > looking at the spellchecker code to try and figure out how it works/what I
> > need to do to make it work in the OSX port. I've looked at spellchecker.cc
> > and its associated files in /chrome/browser/ and everything there makes
> > sense more or less, but I'm having a little trouble figuring out where calls
> > to the spellchecker come from. I'd guess this is something that would happen
> > over IPC, given that the spellchecker lives on the I/O thread and the
> > content of tabs will live in their own processes. If anyone could point me
> > in the right direction to understand how this whole process works, that
> > would be great.
>
> > -Paul Wicks
--~--~-~--~~~---~--~~
Chromium Developers mailing list: chromium-dev@googlegroups.com 
View archives, change email options, or unsubscribe: 
http://groups.google.com/group/chromium-dev
-~--~~~~--~~--~--~---



[chromium-dev] Re: Auto Spelling Correction

2009-05-29 Thread sidchat

> *Hasn't* the dog ate his food.
Yes - this is due to the bug 
http://code.google.com/p/chromium/issues/detail?id=11897
- it seems that bug has reappeared.

-Sid

>
> -- Mohamed Mansour
>
> On Fri, May 29, 2009 at 7:02 PM, Mohamed Mansour
> wrote:
>
>
>
> > Okay I found
> > a couple of errors. Been testing it since you guys have committed it.
> > You cannot do contractions. Try typing has not, will not, does not, etc.
> > You can't do it. Try making the first letter capitalized.
>
> > -- Mohamed Mansour
>
> > On Fri, May 29, 2009 at 2:09 PM, Mohamed Mansour  > > wrote:
>
> >> I hope it "isn't  a bug. Because people might need them :)
> >> Just type 'believe', and use your arrow keys to goto the 'i', and delete
> >> that. And add the 'i' after the 'e' . And you will properly have
> >> the erroneous word.
>
> >> -- Mohamed Mansour
>
> >> On Fri, May 29, 2009 at 12:50 PM, Nick Baum wrote:
>
> >>> Wait wait, how did you manage to write those??
> >>> :)
> >>> -Nick
>
> >>> On Thu, May 28, 2009 at 6:12 PM, Mohamed Mansour <
> >>> m0.interact...@gmail.com> wrote:
>
> >>>> Great job! I now can't be embarrassed when I
> >>>> write beleive or recieve :)
> >>>> Thanks :)
>
> >>>> -- Mohamed Mansour
>
> >>>> On Thu, May 28, 2009 at 7:25 PM, Nick Baum wrote:
>
> >>>>> Great to see this live, Sid!
> >>>>> To
> >>>>> clarify, we're deliberately not including any UI for now, and we expect 
> >>>>> this to be somewhat annoying at first. The hope is that you can
> >>>>> help us figure
> >>>>> out what's annoying about it, and we'll try to improve the algorithm. 
> >>>>> Once it's more helpful than annoying, we'll add UI to handle exceptions.
>
> >>>>> Give it a try and let us know how it works for you!
>
> >>>>> -Nick
>
> >>>>> On Thu, May 28, 2009 at 3:52 PM, sidchat  wrote:
>
> >>>>>> The new dev build (3.0.182.2) now has a command line option to enable
> >>>>>> auto spell corrections. This feature will correct words which have
> >>>>>> been typed wrong due to swapping letters once by mistake - a very
> >>>>>> common example is typing "teh" instead of "the" - "moer" instead of
> >>>>>> "more" and so on.
>
> >>>>>> There are no UI support for this yet - just the command line enabler
> >>>>>> '--auto-spell-correct'. Please do take a look at it and tell me issues
> >>>>>> about it. If we are sure we want this feature, I will go ahead and
> >>>>>> make this a full blown Chrome feature by adding UI support (disable
> >>>>>> through context menu and Options menu, "Stop auto-correcting this
> >>>>>> word" options etc).
>
> >>>>>> -Sid
--~--~-~--~~~---~--~~
Chromium Developers mailing list: chromium-dev@googlegroups.com 
View archives, change email options, or unsubscribe: 
http://groups.google.com/group/chromium-dev
-~--~~~~--~~--~--~---



[chromium-dev] Auto Spelling Correction

2009-05-28 Thread sidchat

The new dev build (3.0.182.2) now has a command line option to enable
auto spell corrections. This feature will correct words which have
been typed wrong due to swapping letters once by mistake - a very
common example is typing "teh" instead of "the" - "moer" instead of
"more" and so on.

There are no UI support for this yet - just the command line enabler
'--auto-spell-correct'. Please do take a look at it and tell me issues
about it. If we are sure we want this feature, I will go ahead and
make this a full blown Chrome feature by adding UI support (disable
through context menu and Options menu, "Stop auto-correcting this
word" options etc).

-Sid
--~--~-~--~~~---~--~~
Chromium Developers mailing list: chromium-dev@googlegroups.com 
View archives, change email options, or unsubscribe: 
http://groups.google.com/group/chromium-dev
-~--~~~~--~~--~--~---