Jump to content


Photo

[APP/MOD] CM7 - LatinIME with Finnish layout and dictionary

* * * * * 1 votes

  • Please log in to reply
30 replies to this topic

#1
sm4tik

sm4tik

    Addict

  • Members
  • PipPipPipPipPip
  • 508 posts
  • Gender:Male
  • Location:Jyväskylä
  • Devices:Blade
UPDATE Jul 25

I've removed libjni_latinime.so from the flashable zip, should be safe to try with other roms now. Remember to backup your original LatinIME.apk just in case.

UPDATE Jul 18

The Finnish layout got merged into N135, dictionary is still under review. I finally managed to make the flashable zip in which I included libjni_latinime.so too. You could try this with other gingerbread roms also (NOT TESTED!). Please let me know how it goes.
EDIT: DON'T USE WITH OTHER ROMS,WILL CAUSE FORCE CLOSES. I'll update the zip next week when I'm back home.Thanks KonstaT for your info!

v0.21
Optimized apk

v0.2
Fixed alternate characters
Added Finnish dictionary by Tero Auvinen (the one used with Scandinavian Keyboard)

v0.1
Initial release

Clockwork flashable zip
latinime-fi-signed.zip
md5 5ece57ff41462b985f8bc235fa806df6

Edited by sm4tik, 25 July 2011 - 08:19 PM.

  • 2

#2
tonnikala

tonnikala

    Newbie

  • Members
  • Pip
  • 24 posts
  • Devices:ZTE Blade, HTC Hero
Nice to hear that somebody is working with this issue.

I looked for a Finnish main.dict and found one with a size of 78 kB (swedish one is a 911 kB). That dictionary was included on http://forum.xda-dev...ad.php?t=875202 this release and on a Multiling keyboard (can be found from a market).

Maybe HTC keyboard could help us with that dictionary?

If we start to make own dictionary from a scratch, here are a few good links:
http://code.google.c...aryDictionaries
http://forum.xda-dev...d.php?t=1027207
http://kaino.kotus.fi/sanat/nykysuomi/ (nykysuomen sanalista - tästä toki puuttuu sanojen esiintymistiheys, joten voi olla käyttökelvoton)
http://android.git.k...e275504;hb=HEAD (painotuksesta asiaa)

  • 1

#3
sm4tik

sm4tik

    Addict

  • Members
  • PipPipPipPipPip
  • 508 posts
  • Gender:Male
  • Location:Jyväskylä
  • Devices:Blade

Nice to hear that somebody is working with this issue.

I looked for a Finnish main.dict and found one with a size of 78 kB (swedish one is a 911 kB). That dictionary was included on http://forum.xda-dev...ad.php?t=875202 this release and on a Multiling keyboard (can be found from a market).

Maybe HTC keyboard could help us with that dictionary?

If we start to make own dictionary from a scratch, here are a few good links:
http://code.google.c...aryDictionaries
http://forum.xda-dev...d.php?t=1027207
http://kaino.kotus.fi/sanat/nykysuomi/ (nykysuomen sanalista - tästä toki puuttuu sanojen esiintymistiheys, joten voi olla käyttökelvoton)
http://android.git.k...e275504;hb=HEAD (painotuksesta asiaa)

Thanks for the links. Actually the gingerbread keyboard I'm using is the same keyboard you linked to at XDA. It's only been stripped down to fi and en and the person who posted it to androidsuomi.fi has done changes to the fi layout so it shows all the numbers in top row. The finnish dictionary is usable, but not the best I've seen, I think it was the one in scandinavian keyboard that was quite impressive. Not sure though, it's been a while since I used it last time.
I think I don't have time to start a dictionary from scratch atm, but if someone want's to do it, please do :)

edit: ..sorry I lied, the dictionary is NOT the same, it's over 900K. Uploading an update in a few moments.

Edited by sm4tik, 14 July 2011 - 10:24 AM.

  • 2

#4
tonnikala

tonnikala

    Newbie

  • Members
  • Pip
  • 24 posts
  • Devices:ZTE Blade, HTC Hero
Hmm..

I checked that scandinavian keyboard. I found a .dict-file and it actually worked with LatinIME.apk keyboard. Maybe we can use that dictionary (or is it allowed)? That dictionary contains 80000 unique weighted words and its size is 973 kB. Sounds good to me. On my testings I just replaced Swedish dictionary with Finnish one.

It is possible to fix that layout problem with copying .xml-files form \res\xml-sv\ to \res\xml-fi\ (within .apk-file)
That didin't got Finnish dictionary working (I made raw-fi folder and put that dictionary there).

To get the source right - I'm not a right person to do it... :)

Edited by tonnikala, 14 July 2011 - 09:58 AM.

  • 0

#5
tonnikala

tonnikala

    Newbie

  • Members
  • Pip
  • 24 posts
  • Devices:ZTE Blade, HTC Hero
I just found this one: http://forum.xda-dev...ad.php?t=695701

With that tool I managed to get Finnish layout (by copying swedish one's .xml's) and Finnish dictionary working. Now it displays on "Input languages" Suomi(Suomi) - dictionary available :)

You can download modified keyboard from here: http://koti.mbnet.fi...la/LatinIME.zip

It uses scandinavian keyboard's dictionary.

Edited by tonnikala, 14 July 2011 - 10:50 AM.

  • 1

#6
sm4tik

sm4tik

    Addict

  • Members
  • PipPipPipPipPip
  • 508 posts
  • Gender:Male
  • Location:Jyväskylä
  • Devices:Blade
Updated first post.
v0.2
Fixed alt characters
Added Finnish dictionary

Question about the output directory after building CM7
There is a system directory inside out/target/product/blade, what's the difference between this and the one in the update.zip? I found the LatinIME.apk to be only 8.2M in out/.../system/app while the one in the update.zip is over 12M (after including the Finnish stuff into it). Both seem to work the same?

BTW, how the heck do I edit the thread title with this new forum thing?

  • 1

#7
sm4tik

sm4tik

    Addict

  • Members
  • PipPipPipPipPip
  • 508 posts
  • Gender:Male
  • Location:Jyväskylä
  • Devices:Blade

Hmm..

I checked that scandinavian keyboard. I found a .dict-file and it actually worked with LatinIME.apk keyboard. Maybe we can use that dictionary (or is it allowed)? That dictionary contains 80000 unique weighted words and its size is 973 kB. Sounds good to me. On my testings I just replaced Swedish dictionary with Finnish one.

It is possible to fix that layout problem with copying .xml-files form \res\xml-sv\ to \res\xml-fi\ (within .apk-file)
That didin't got Finnish dictionary working (I made raw-fi folder and put that dictionary there).

To get the source right - I'm not a right person to do it... :)

Maybe there's somebody out there who can help us to get that dictionary right. I don't want to include a dictionary which turns out to be something that's copyrighted or whatever. The current dictionary I added is 976K in size, but I have no idea where it's originally from!!

  • 1

#8
tonnikala

tonnikala

    Newbie

  • Members
  • Pip
  • 24 posts
  • Devices:ZTE Blade, HTC Hero

<br />Maybe there's somebody out there who can help us to get that dictionary right. I don't want to include a dictionary which turns out to be something that's copyrighted or whatever. The current dictionary I added is 976K in size, but I have no idea where it's originally from!!


Yeah. That scandinavian keyboard's Finnish dictionary is made by Tero Auvinen (ta (at) iki.fi). I have no idea abuot GPL's or other Lincenses - what these allows and so on..

Edited by tonnikala, 14 July 2011 - 11:14 AM.

  • 0

#9
KonstaT

KonstaT

    Hardcore

  • Developer Team
  • PipPipPipPipPipPip
  • 2,770 posts
  • Gender:Male
  • Location:Finland
  • Devices:Moto G, ZTE Open C
  • Twitter:@konstatuomio
Thanks for this. You inspired me to make one for myself too. :)

I just noticed last night that scandinavian keyboard with finnish dictionary doesn't work with gingerbread (Ginger Stir Fry). The keyboard itself works but it only suggests words that are in user dictionary.

I used CM7N131 LatinIME.apk and finnish dictionary by Tero Auvinen. You could really trim it down by compressing and optimizing it properly. Mine is less than 8mb with all dictionarys and I also made a version with only english-finnish-swedish and it's just over 2mb.

You could contact Tero Auvinen and ask if you can use his dictionary. It's a free addon to a free application so I think it should be fine as long as your not trying to sell your keyboard. Here is a market link for that: https://market.andro...nnishdictionary Are you trying to get this included in CM7?

Your v0.2 seems pretty much finished so may I suggest you make that into a flashable zip.

Good job.

  • 2

#10
sm4tik

sm4tik

    Addict

  • Members
  • PipPipPipPipPip
  • 508 posts
  • Gender:Male
  • Location:Jyväskylä
  • Devices:Blade

Thanks for this. You inspired me to make one for myself too. :)

I just noticed last night that scandinavian keyboard with finnish dictionary doesn't work with gingerbread (Ginger Stir Fry). The keyboard itself works but it only suggests words that are in user dictionary.

I used CM7N131 LatinIME.apk and finnish dictionary by Tero Auvinen. You could really trim it down by compressing and optimizing it properly. Mine is less than 8mb with all dictionarys and I also made a version with only english-finnish-swedish and it's just over 2mb.

You could contact Tero Auvinen and ask if you can use his dictionary. It's a free addon to a free application so I think it should be fine as long as your not trying to sell your keyboard. Here is a market link for that: https://market.andro...nnishdictionary Are you trying to get this included in CM7?

Your v0.2 seems pretty much finished so may I suggest you make that into a flashable zip.

Good job.

I compared the dictionary I used and the one by Tero and it's a match :)
You're right about optimizing the apk, now it's down to 7,5M. It didn't cross my mind apk's in CM are not optimized by default.. you learn something new every day! I'll look into making it into a flashable zip, that's another thing I've meant to learn for a while now. I think it could be a good idea to make two versions, one "official" with Finnish included and another one like your stripped down version. It was my initial idea to try to get this through upsream, but I think it might a bit of an overkill to add 1M to CM just make the few Finnish guys happy. We'll see where all this will be heading.

  • 1

#11
sm4tik

sm4tik

    Addict

  • Members
  • PipPipPipPipPip
  • 508 posts
  • Gender:Male
  • Location:Jyväskylä
  • Devices:Blade
Updated first post.
Optimized the apk, now under 7.5M.

  • 1

#12
wbaw

wbaw

    account closed

  • Banned
  • PipPipPipPipPipPip
  • 1,885 posts
  • Gender:Not Telling

I compared the dictionary I used and the one by Tero and it's a match :)
You're right about optimizing the apk, now it's down to 7,5M. It didn't cross my mind apk's in CM are not optimized by default.. you learn something new every day! I'll look into making it into a flashable zip, that's another thing I've meant to learn for a while now. I think it could be a good idea to make two versions, one "official" with Finnish included and another one like your stripped down version. It was my initial idea to try to get this through upsream, but I think it might a bit of an overkill to add 1M to CM just make the few Finnish guys happy. We'll see where all this will be heading.


I wouldn't worry about the extra 1mb. If they cared about things like that then they could compress their apks better & save a lot more space. They do care about supporting other languages, but they need native speakers to submit patches.

See if you can submit a patch for Finnish support in the keyboard & then it's up to them if they want to include it or not.

Edited by wbaw, 15 July 2011 - 09:47 PM.

  • 0

#13
sm4tik

sm4tik

    Addict

  • Members
  • PipPipPipPipPip
  • 508 posts
  • Gender:Male
  • Location:Jyväskylä
  • Devices:Blade

I wouldn't worry about the extra 1mb. If they cared about things like that then they could compress their apks better & save a lot more space. They do care about supporting other languages, but they need native speakers to submit patches.

See if you can submit a patch for Finnish support in the keyboard & then it's up to them if they want to include it or not.

Yeah, I guess you're right. The layout and dictionary are in different branches anyway so I guess this would mean 2 commits? Even if the dictionary wouldn't get merged, I think CM would still benefit for having a fi layout. Lack of it has been mentioned many times in different places and for people new to CM (or android in general) this would mean much less confusion. Atleast it took me quite a while to figure out that it wasn't my fault, the settings were all right but the layout just wasn't available even though it was listed under input languages.

  • 1

#14
KonstaT

KonstaT

    Hardcore

  • Developer Team
  • PipPipPipPipPipPip
  • 2,770 posts
  • Gender:Male
  • Location:Finland
  • Devices:Moto G, ZTE Open C
  • Twitter:@konstatuomio
This is slightly off topic, but it's about finnish localization. If your about to commit stuff to CM7, here is another idea. Changing clock format from HH.mm to HH:mm. Small thing but I know it's been bugging lots of people. This might be happening for norwegians so why not for finns too...

Make Norwegian use HH:MM time format instead of HH.MM
http://review.cyanog...om/#change,6685

  • 0

#15
sm4tik

sm4tik

    Addict

  • Members
  • PipPipPipPipPip
  • 508 posts
  • Gender:Male
  • Location:Jyväskylä
  • Devices:Blade

This is slightly off topic, but it's about finnish localization. If your about to commit stuff to CM7, here is another idea. Changing clock format from HH.mm to HH:mm. Small thing but I know it's been bugging lots of people. This might be happening for norwegians so why not for finns too...

Make Norwegian use HH:MM time format instead of HH.MM
http://review.cyanog...om/#change,6685

I'll do that one too now that I'm on this. How about the translation,do you know if there is someone working on it? Any other stuff us Finns are missing?

Anyway, here's the gerrit review link for a Finnish layout. I still have to contact Tero about the dictionary.
http://review.cyanog...om/#change,6742

edit: About the dictionary. If anyone knows whether it should go to
vendor/cyanogen/overlay/dictionaries/packages/inputmethods/LatinIME/java/res
or
vendor/cyanogen/overlay/common/packages/inputmethods/LatinIME/java/res
please let me know!
The dictionary in my build is in the first path (just followed the Swedes). What's the difference between the two?

Edited by sm4tik, 16 July 2011 - 08:25 PM.

  • 1

#16
sm4tik

sm4tik

    Addict

  • Members
  • PipPipPipPipPip
  • 508 posts
  • Gender:Male
  • Location:Jyväskylä
  • Devices:Blade
The layout got merged, I've contacted Tero about the dictionary and as soon as I get his approval (I hope) I'll submit it too. Still have to fix that clock format, the fix for Norwegians got merged so I think it won't take long for it to go through. I'll keep y'all updated.

edit: http://review.cyanog...om/#change,6762

I'm not going to fix the time format as it is correct the way it is according to standards. I guess the colon separation is just something we're all just used to, atleast I am.

Edited by sm4tik, 17 July 2011 - 07:14 PM.

  • 1

#17
sm4tik

sm4tik

    Addict

  • Members
  • PipPipPipPipPip
  • 508 posts
  • Gender:Male
  • Location:Jyväskylä
  • Devices:Blade
Updated first post.
Now flashable with clockwork. I tested it with CWM 3.0.2.7, but it's the first update.zip I've created, so if there are any prolems with it please let me know!

Edited by sm4tik, 18 July 2011 - 10:56 PM.

  • 1

#18
KonstaT

KonstaT

    Hardcore

  • Developer Team
  • PipPipPipPipPipPip
  • 2,770 posts
  • Gender:Male
  • Location:Finland
  • Devices:Moto G, ZTE Open C
  • Twitter:@konstatuomio
Well done.

I think you could lose the libjni_latinime.so though. Almost every ROM has one already. If you try to install this to Ginger Stir Fry or other ZTE leak based ROMs, all you'll get is force-closes. Libs are not interchangeable because of the 2G-3G vmsplit difference.

Hope to see the dictionary pushed forward to the CM7 too. :)

  • 0

#19
sm4tik

sm4tik

    Addict

  • Members
  • PipPipPipPipPip
  • 508 posts
  • Gender:Male
  • Location:Jyväskylä
  • Devices:Blade

Well done.

I think you could lose the libjni_latinime.so though. Almost every ROM has one already. If you try to install this to Ginger Stir Fry or other ZTE leak based ROMs, all you'll get is force-closes. Libs are not interchangeable because of the 2G-3G vmsplit difference.

Hope to see the dictionary pushed forward to the CM7 too. :)

I'm away from home for this week, so I can't fix it.Thanks for the info,I thought there might've been something tricky with that lib..I'll update the first post and fix it as soon as I get back home!

  • 0

#20
sm4tik

sm4tik

    Addict

  • Members
  • PipPipPipPipPip
  • 508 posts
  • Gender:Male
  • Location:Jyväskylä
  • Devices:Blade
Removed libjni_latinime.so from the zip, updated first post.

  • 0




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users