Re: [orca-list] How to write extension for ibus input method?



Thank you! Joanmarie

I have tested the latest code. It works. I think the experience is acceptable although removing the trailing number is better. However, since the number do exists in the panel and there is no connection between the panel and input method, removing it should do harm to other applications.

In future better way of customization, I am still interested in the way of writing a script for ibus-pinyin. I am not sure whether this is a framework issue that there is no way to know whose parent the panel is.

There is still two issues need to solve:

First, there are 5 candidate characters in the ibus input method panel. It turns to next page if we press 5 times down arrow key. However, when I move cursor on 6th to 10th candidate characters, it reads 1st to 5th candidate characters actually. It seems always reads the first page of the panel.

Second, after a few times navigation on ibus panel, Orca become silence totally. Press SUPER+ALT+S twice to restart Orca doesn't work. I need to reboot the system to make Orca work again. It seems Orca enter some abnormal state.

Cameron

2018-03-27 4:07 GMT+08:00 Joanmarie Diggs <jdiggs igalia com>:
Hi Cameron.

Ok, I think I have something in Orca master which will hopefully make it
possible for you to get closer to the experience you had before. The
changes I made in Orca were pretty simple:

1. Eliminated the speaking of "panel."
2. Look up labels that are one character long in Orca's character name
   dictionary.

Orca doesn't have its own entries for these characters but you can add
them to your Orca customizations (which by default lives in
$HOME/.local/share/orca/orca-customizations.py). I did this with the
third candidate character like so:

import orca.chnames
orca.chnames.chnames['张'] = 'hello world'

Then when I arrowed among characters 1, 2, and 3 I got:

'在 1' (spoken as "chinese character 1")
'之 2' (spoken as "chinese character 2")
'hello world 3'

In other words, if there's no match, Orca should do what it always does.
But if there is a match, Orca should speak the match instead of the
displayed character. If you could try making a few entries like that in
your local orca-customizations.py file and let me know if you get the
experience you'd like, that would be great. And if it is what you had in
mind, then I have a follow-up question for you:

In your original message, you indicated that before the ibus input
method became semi-accessible:

> I have hacked ibus package to call speech dispatcher to achieve my
> purpose directly in Ubuntu 14.04 and Ubuntu 16.04

Are you saying that speech-dispatcher has entries with the descriptions
in them? Or that your hack included the descriptions you wanted spoken
and your hack told speech-dispatcher to speak your descriptions?

Thanks for your help on this!
--joanie

On 03/23/2018 09:25 PM, Cameron Wong wrote:
> Great!
>
> When we input Chinese with pinyin input method, we need to choose the
> right character with the same sound. For example, there are many
> character map to "zhong". There all pronounce the same (although some
> with different tone). We need to explain it in word context to user like
> below:
>
> When cursor on first candidate character of "zhong" - "中", Orca should
> say "中国的中", which means this is the first character of China.
> When cursor on second candidate character of "zhong" - "种", Orca should
> say "种子的种", which means this is the first character of seed.
>
> I wrote a dictionary for explaining all Chinese character in the input
> method before. I need to find a way to replace the default output of
> Orca "panel, Chinese letter n" with explanatin of that "Chinese letter"
> in my dictionary.
>
> Cameron
>
> 2018-03-24 2:17 GMT+08:00 Joanmarie Diggs <jdiggs igalia com
> <mailto:jdiggs igalia com>>:
>
>     Thanks! I can reproduce it. What would you like Orca to say instead of
>     what it is saying now?
>
>     --joanie
>
>     On 03/22/2018 11:10 AM, Cameron Wong wrote:
>     > Hi Joanmarie,
>     >
>     > Here is the steps to reproduce the issue. (I try it on a Ubuntu
>     live CD
>     > in English language.)
>     >
>     > 1. Install and setup ibus-libpinyin
>     > $ sudo apt install ibus-libpinyin
>     > You may not need to install since I find it already installed in an
>     > Ubuntu live CD.
>     >
>     > Setup Chinese input method in following procedure:
>     > Ubuntu 18.04(dev)->System Setting->Region & Language->Input
>     > Sources->add(+)->Chinese(Intelligent Pinyin)
>     >
>     > 2. Activate Chinese input method
>     > Open a terminal
>     > Press SUPER+SPACE, you will see an icon on the top right window
>     changed
>     > from “En” to “中”
>     > Then input “zhong”(in fact “zh” is enough), you will see a panel
>     with 5
>     > Chinese characters whose pinyin is “zhong”. Press Up and Down
>     array key
>     > to move cursor to select Chinese character.
>     > When you press UP and Down array key, Orca(with eSpeak) will say
>     “panel,
>     > Chinese letter 1”, “panel, Chinese letter 2” etc. If you use a TTS
>     > support Chinese, the word “Chinese letter” will be replaced with the
>     > real sound of that Chinese character. But you don’t need to bother to
>     > install a Chinese TTS.
>     >
>     > My goal is to find a way to customize the content of “panel, Chinese
>     > letter 1”.
>     >
>     > Many thanks!
>     >
>     > Cameron
>     >
>     > 2018-03-22 20:28 GMT+08:00 Joanmarie Diggs <jdiggs igalia com
>     <mailto:jdiggs igalia com>
>     > <mailto:jdiggs igalia com <mailto:jdiggs igalia com>>>:
>     >
>     >     Hi Cameron.
>     >
>     >     I'll take a look. But I know absolutely nothing about
>     ibus-pinyin. What
>     >     steps do I need to take to launch/view the panel in question?
>     >
>     >     Thanks!
>     >     --joanie
>     >
>     >     On 03/22/2018 05:59 AM, Cameron Wong wrote:
>     >     > Hi developers,
>     >     >
>     >     > I am trying to make ibus-pinyin input method readable.
>     >     >
>     >     > I have hacked ibus package to call speech dispatcher to
>     achieve my
>     >     > purpose directly in Ubuntu 14.04 and Ubuntu 16.04 without
>     touching
>     >     > Orca's code in the pass years. In the old days, Orca did not
>     read ibus
>     >     > input method at all.
>     >     >
>     >     > However, from Ubuntu 18.04 which switches to Gnome 3, Orca
>     can read ibus
>     >     > input method panel a bit but far from good enough. I use
>     accerciser to
>     >     > analyze ibus input method panel. It belongs to gnome-shell
>     not its
>     >     > lauching process ibus-engine-pinyin. And there no properties
>     that I can
>     >     > identified this panel belongs to ibus.
>     >     >
>     >     > So it there a way I can write app script to change the way
>     Orca reads
>     >     > ibus input method panel?
>     >     >
>     >     > If there is no easy way to write a script to read ibus input
>     method
>     >     > panel, is there a way to disable Orca reading ibus input
>     method panel?
>     >     > Then I can read it in my old way.
>     >     >
>     >     > Or are there any other suggestions?
>     >     >
>     >     > Thanks a lot!
>     >     >
>     >     > Cameron Wong
>     >     >
>     >     >
>     >     >
>     >     > _______________________________________________
>     >     > orca-list mailing list
>     >     > orca-list gnome org <mailto:orca-list gnome org>
>     <mailto:orca-list gnome org <mailto:orca-list gnome org>>



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]