Author Topic: Predictive Text Input Method For Superfast Typing  (Read 5817 times)

ShiroiKuma

  • Hero Member
  • *****
  • Posts: 900
    • View Profile
Predictive Text Input Method For Superfast Typing
« on: November 21, 2005, 06:03:54 pm »
I've tried to compile Prime for RC12. For those who do not know it's an input method for Japanese for uim.

However, though it was designed for Japanese it works with English.

Basically, after you type a word, you select it from a scrollable list of alternatives with the space-bar - there's alternatives in Japanese, but one is also in English.

Then later, when you start typing the word, it comes up as an option right after the first character.

It's very potent, and super on the zaurus, if you write a lot, after you have typed a couple of hundred words, it will remember your word selections and you mostly end up just typing first two letters of the word or so and then get offered the word you wanna type. Very good.

Now, Prime's homepage is at: http://taiyaki.org/prime/

Prime needs Ruby, which has been compiled for pdaXrom, it's at: http://www.pdaxrom.org/unstable/ruby_1.8.2_armv5tel.ipk

Then it needs suikyo, sary, and sary bindings for ruby.

I've compiled Prime, prime-dict, suikyo, and sary.

I'm including the sary ipk with this post.

Now the only thing missing to compile is sary's ruby bindings which is a 9k file, you can get it here: http://sary.sourceforge.net/sary-ruby-1.2.0.tar.gz

But it's not compiled by the regular configure, make, make install way. Instead the Makefile is generated by Ruby. So you untar it, run "ruby extconf.rb" and then you can do make etc...

For this you first need to install ruby and sary.

But I can't get this "ruby extconf.rb" to work, I get an error saying:
Code: [Select]
checking for sary.h... noBut sary.h is in /usr/local/include/ that's where it's installed when you install sary.

So I'm guessing it's some ruby or sary config setup, but can't figure out how to fix this.

Can someone try and find out how to do it. It's just the last little step and we'll have this fenomenal way to input text predictively, super fast under pdaXrom.
[span style=\'font-size:8pt;line-height:100%\']Das ganze tschechische Volk ist eine Simulantenbande.[/font][/span]
Militäroberarzt Bautze

pgas

  • Hero Member
  • *****
  • Posts: 1097
    • View Profile
    • http://
Predictive Text Input Method For Superfast Typing
« Reply #1 on: November 22, 2005, 03:49:50 am »
Quote
But I can't get this "ruby extconf.rb" to work, I get an error saying:
CODE
checking for sary.h... no

But sary.h is in /usr/local/include/ that's where it's installed when you install sary.

I don't know why ruby can't find the header as everything seems ok.
so I edit extconf.rb to comment out the test if header etc...
and run:
Code: [Select]
CFLAGS=`pkg-config sary --cflags` LDFLAGS=`pkg-config sary --libs` /usr/bin/ruby extconf.rb
I added the CFLAGS and LDFLAGS variables just in case and it creates the Makefile.

I then edited the Makefile to remove the amrv5tel... etc prefix before gcc.

Run make and voila attached is the result of make install.

Notes:
- If you are going to make ipk you can make 2 ipks for the lib one for development which is like the one you have posted here, and one without the .a include header etc, containing only the .so libs (you can strip the libs using "strip libxx.so.10.0.0" to decrease their sizes) for those who just want to use it.

- I tried first with ruby 1.8.3 that can be found here, but the headers are missing from the ipk.
SLC-860 cacko / senao wifi

ShiroiKuma

  • Hero Member
  • *****
  • Posts: 900
    • View Profile
Predictive Text Input Method For Superfast Typing
« Reply #2 on: November 22, 2005, 04:36:13 am »
Quote
- I tried first with ruby 1.8.3 that can be found here, but the headers are missing from the ipk.
[div align=\"right\"][a href=\"index.php?act=findpost&pid=104513\"][{POST_SNAPBACK}][/a][/div]
Did you then recompile Ruby?

I think I'm using the same version and there seem to be some problems: downloaded your sary-ruby, made an ipkg. Then installed everything for Prime.

Now when you start uim-xim, it says it selects prime. Then I start uim-toolbar-gtk-systray. No prob.

Then when you launch a GTK application to write, you get error messages in the console, saying a required Ruby module socket not found, then some more...

The systray icon for uim-xim switches to Prime, so something is working, but obviously no output - due to Ruby errors.

Am compiling Ruby 1.4preview now, don't know how long it's gonna take on the Z. If it doesn't work after this I'll report what's wrong...
[span style=\'font-size:8pt;line-height:100%\']Das ganze tschechische Volk ist eine Simulantenbande.[/font][/span]
Militäroberarzt Bautze

pgas

  • Hero Member
  • *****
  • Posts: 1097
    • View Profile
    • http://
Predictive Text Input Method For Superfast Typing
« Reply #3 on: November 22, 2005, 04:39:59 am »
Quote
Did you then recompile Ruby?

No, I used http://www.pdaxrom.org/unstable/ruby_1.8.2_armv5tel.ipk
SLC-860 cacko / senao wifi

ShiroiKuma

  • Hero Member
  • *****
  • Posts: 900
    • View Profile
Predictive Text Input Method For Superfast Typing
« Reply #4 on: November 22, 2005, 04:42:08 am »
Quote
Quote
Did you then recompile Ruby?

No, I used http://www.pdaxrom.org/unstable/ruby_1.8.2_armv5tel.ipk
[div align=\"right\"][a href=\"index.php?act=findpost&pid=104519\"][{POST_SNAPBACK}][/a][/div]
Hmmm, this is the one I just tried, it gives the errors. Not sure if it's Ruby related or Prime related, but the modules are not Prime's. Then later it goes on to complain some Ruby Prime modules are missing... Well, hopefully this Ruby native compilation will go fine, so far no errors, has been running for cca 20 minutes. and maybe then it'll move.
[span style=\'font-size:8pt;line-height:100%\']Das ganze tschechische Volk ist eine Simulantenbande.[/font][/span]
Militäroberarzt Bautze

ShiroiKuma

  • Hero Member
  • *****
  • Posts: 900
    • View Profile
Predictive Text Input Method For Superfast Typing
« Reply #5 on: November 22, 2005, 11:10:07 am »
Oh man, a nightmare...

What I did, I installed the 1.8.3 Ruby without headers and with it I did get Prime working, could write and everything.

But then did some library stripping like you mentioned and had to reflash because I wanted to install a couple of packages cleanly.

Now can't get the stuff to move. Built all the ipks. Can install them no probs.

Then when I start uim-xim and run anthy the input works, when you switch to prime, uim says "backtrace" which means error in uim lingo and says no such file or directory. This is related to where prime, sary and so on files and directories lay, I had to do some symlinking before since it was looking for the files in the wrong locations and it worked. But I have the symlinks now and no luck...

Man...

Will try to compily Ruby 1.8.4 preview - which bombed in the meantime, to see if this'll work...

Any other suggestions?
[span style=\'font-size:8pt;line-height:100%\']Das ganze tschechische Volk ist eine Simulantenbande.[/font][/span]
Militäroberarzt Bautze

jcabrer

  • Full Member
  • ***
  • Posts: 161
    • View Profile
Predictive Text Input Method For Superfast Typing
« Reply #6 on: November 22, 2005, 06:47:25 pm »
When I began packaging ipks for pdaXrom, I left --prefix at the default which is /usr/local for most packages.  Quickly I found that certain packages could/would not find includes and libs unless --prefix=/usr, so now I build everything with:
./configure --prefix=/usr && make && make prefix=/ipks/pkg_nm/usr install

It solves most headaches.
Sharp SL-C3100 - pdaXrom Beta 3
Sharp SL-6000L - pdaXrom Beta 1

ShiroiKuma

  • Hero Member
  • *****
  • Posts: 900
    • View Profile
Predictive Text Input Method For Superfast Typing
« Reply #7 on: November 25, 2005, 03:20:30 am »
Quote
When I began packaging ipks for pdaXrom, I left --prefix at the default which is /usr/local for most packages.  Quickly I found that certain packages could/would not find includes and libs unless --prefix=/usr, so now I build everything with:
./configure --prefix=/usr && make && make prefix=/ipks/pkg_nm/usr install
[div align=\"right\"][{POST_SNAPBACK}][/a][/div]
It was sorta what you were saying but actually reverse, the files compile to /usr/ but uim looks for most stuff in /usr/local/ so it kept bombing out. The problem with debugging uim is that it gives you no clear error messages, it just says "backtrace..." for any error encounters, talk about helpful...

Anyhow, for anyone that is interested, I've compiled it and gotten it to work. So this is what you need to do to get PRIME working on your Z.

1. From the [a href=\"http://mail.pdaxrom.org/rc12/Zaurus-7x0-860/feed/]RC12 feed for SL-C860[/url] install first package orbit2 and then package gconf. If your Z model is another, select the RC12 feed appropriately.
2. From the Japanese pdaXrom feed install uim.
3. Install Ruby 1.8.3, I've compiled it, it's available here.
4. Install the following packages:
prime-dict_1.0.0_armv5tel.ipk
prime_1.0.0.1_armv5tel.ipk
ruby-progressbar_0.9-1_armv5tel.ipk
sary-ruby_1.2.0_armv5tel.ipk
sary_1.2.0_armv5tel.ipk
suikyo_2.1.0_armv5tel.ipk
uim-prime_0.9.4_armv5tel.ipk
5. edit ~/.xinitrc or if you're using xfce4 edit ~/xinitrc.xfce4 and add somewhere at the beginning the following two lines:
Code: [Select]
export XMODIFIERS=@im=uim
export GTK_IM_MODULE=uim-prime
6. Restart X.

And that's it, now PRIME will work.

When you switch to a GTK application for text entry (you can try Leafpad, a very good UTF-8 editor) press Shift+Space and you can enter text predictively. Just type along, start typing a word and the options will pop up.

Don't be scared at first, if you're not used to Japanese, and if you don't have Japanese fonts installed, the first options will probably be rubbish, because they'll be Japanese, but then automatically PRIME when you start typing the word beginning with the same letters automatically suggests as first your most used option.

Basically it takes just tens or a couple hundred of words of your usual text and you'll get all the right option, after then it's just a matter of typing the first letter, or a couple of letters from a word, selecting the right one with space and entering it with enter. It becomes very fast on the Zaurus, I don't type texts in any other way using the small keyboard.

Enjoy.
[span style=\'font-size:8pt;line-height:100%\']Das ganze tschechische Volk ist eine Simulantenbande.[/font][/span]
Militäroberarzt Bautze

stuffman

  • Full Member
  • ***
  • Posts: 104
    • View Profile
    • http://www.dylanpowell.net/zaurus
Predictive Text Input Method For Superfast Typing
« Reply #8 on: December 02, 2005, 02:11:54 am »
Somewhat OT, but there's a great multi-lingual predictive text-input program called Dasher, which I built on my Z a few weeks ago (but I kinda forgot to save it when I upgraded to RC12 and I can't remember everything I had to do to build it). Basically, there is no keyboard use at all- everything is input throught the stylus. Characters are on the right side of the screen, and by moving your stylus towards the character causes them to "fly" towards you. Basically you "steer" your way through the characters, and the most likely ones will appear larger for easier input. It's sort of hard to explain without seeing it in action, but I think it's really nifty. I can leave my Z in portrait mode and enter text without having to open everything back up.

You can check out their website at http://www.inference.phy.cam.ac.uk/dasher/
[span style=\'font-size:8pt;line-height:100%\']SL-C860 Running pdaXrom 1.1.0beta1.
5GB Seagate ST-1 Microdrive from Rio Carbon, Asst. Other CF Cards.
512MB Sandisk SD.
AmbiCom WL1100C-CF WiFi Card.
Some GPS Card I Can't Remember...
Palm Tungsten Retractable Stylus (If You're Not Using These, You're Missing Out!).
[/font][/span]

ShiroiKuma

  • Hero Member
  • *****
  • Posts: 900
    • View Profile
Predictive Text Input Method For Superfast Typing
« Reply #9 on: December 02, 2005, 05:41:26 am »
Quote
Somewhat OT, but there's a great multi-lingual predictive text-input program called Dasher, which I built on my Z a few weeks ago (but I kinda forgot to save it when I upgraded to RC12 and I can't remember everything I had to do to build it).
Can you post the ipk?
[span style=\'font-size:8pt;line-height:100%\']Das ganze tschechische Volk ist eine Simulantenbande.[/font][/span]
Militäroberarzt Bautze

stuffman

  • Full Member
  • ***
  • Posts: 104
    • View Profile
    • http://www.dylanpowell.net/zaurus
Predictive Text Input Method For Superfast Typing
« Reply #10 on: December 03, 2005, 04:24:58 am »
I wish I still had it because it was fun to mess around with, but the .ipk and everything else got erased when I upgraded to RC12. If I have some time this week, I'll try to build it, but I can't make any promises... it's finals week
[span style=\'font-size:8pt;line-height:100%\']SL-C860 Running pdaXrom 1.1.0beta1.
5GB Seagate ST-1 Microdrive from Rio Carbon, Asst. Other CF Cards.
512MB Sandisk SD.
AmbiCom WL1100C-CF WiFi Card.
Some GPS Card I Can't Remember...
Palm Tungsten Retractable Stylus (If You're Not Using These, You're Missing Out!).
[/font][/span]

scoutme

  • Hero Member
  • *****
  • Posts: 579
    • View Profile
Predictive Text Input Method For Superfast Typing
« Reply #11 on: December 03, 2005, 05:56:59 am »
dasher is more funny than fast to me... it's an alternative, anyway