Keheliya Gallaba has created a nice addon which we be can use to view Non Unicode Text in their Unicode equivalents.
Currently this addon supports,
Download
Firefox : http://code.google.com/p/siyabasscript/downloads/list
Chrome : http://userscripts.org/scripts/show/63613
Screencast : http://www.youtube.com/watch?v=TuImKCvvHXY
Jinath Sanjitha's Blog
Hi, friends..
Wednesday, October 06, 2010
Friday, April 30, 2010
google-api-translate-javame version 2.0 is NOW available
Google-api-translate-javame API version 2.0 is NOW available.
It now supports 'Auto-Detect Language' feature and has translation support for more than 40 languages.
Link : http://code.google.com/p/google-api-translate-javame/
It now supports 'Auto-Detect Language' feature and has translation support for more than 40 languages.
Link : http://code.google.com/p/google-api-translate-javame/
Labels:
Google-api-translate-javame,
java
Tuesday, April 27, 2010
Google Transliterate in SINHALA
.
Google Transliterate (http://www.google.com/transliterate/) now supports Sinhala Language.
I tried entering "subha aluth awuruddak wewa" and below is the output.
By checking this service I found out that it does more work than Traditional Phonetic Transliteration.
It has some prediction (AI) capabilities so that in most times it will show the intended word we needed.
I tried the same input with some other similar services and the output was not accurate like in Google Transliterate.
Similar services
Google Transliterate (http://www.google.com/transliterate/) now supports Sinhala Language.
I tried entering "subha aluth awuruddak wewa" and below is the output.
By checking this service I found out that it does more work than Traditional Phonetic Transliteration.
It has some prediction (AI) capabilities so that in most times it will show the intended word we needed.
I tried the same input with some other similar services and the output was not accurate like in Google Transliterate.
Similar services
Labels:
google,
sinhala,
Transliterate
Tuesday, April 06, 2010
PInvoke (Platform Invoke) in C#
Recently I had a requirement of calling some functions in a C++ DLL file which i created, via C#. I achieved it by using PInvoke.
So what is PInvoke ?
The advantage of using PInvoke in my case is that, C++ DLLs compiled to machine Language runs much faster than compiled to CLR.
How to use PInvoke – Basics
Let's assume you have a function int getValue(char c) { ... } in a C++ App. First you have to change and wrap like below.
#ifdef __cplusplus
extern
"C" {
#endif
__declspec(dllexport) int getValue(char c)
{
//some code
return 0;
}
#ifdef __cplusplus
};
#endif
Now recompile the program as a DLL and we are ready to call this function from C#.
So in your C# Application, first include
using System.Runtime.InteropServices;
Then add below line in the class file.
[DllImport("YourDllName.dll", CallingConvention = CallingConvention.StdCall)]
public static extern int getValue(char c);
After that you can call that function just like calling any C# function.
Eg: int i = getValue('a');
How to get a C++ struct from C#
Let's assume that you have a C++ function which returns a structure. And you need to get the returned C++ structure from the C# code. Here is how you should do it.
In the C++ code, the structure should look like this.
#pragma
pack(push, 8)
struct Location {
int x;
int y;
};
#pragma
pack(pop)
And assume that the C++ function (which returns the structure) looks like below,
__declspec(dllexport) Location getLocation(int a)
{
Location loc;
loc.x = 10;
loc.y = 20;
return loc;
}
So in the C# code, it should look like,
[DllImport("YourDllName.dll", CallingConvention = CallingConvention.StdCall)]
[return: MarshalAs(UnmanagedType.Struct)]
public static extern MyLocation startProcessing(int a);
And our own C# struct Type - MyLocation, to which we bind the returned data, should look like below.
[StructLayout(LayoutKind.Sequential)]
public struct MyLocation
{
public int x;
public int y;
}
Then you can call the C++ methid in C# like,
MyLocation loc = startProcessing(10);
If you have any issues, please add a comment so that I can help you as I can !
So what is PInvoke ?
Platform Invocation Services (PInvoke) allows managed code (code which runs in Microsoft CLR) to call unmanaged functions (code compiled directly to Machine Language) that are implemented in a DLL.
The advantage of using PInvoke in my case is that, C++ DLLs compiled to machine Language runs much faster than compiled to CLR.
How to use PInvoke – Basics
Let's assume you have a function int getValue(char c) { ... } in a C++ App. First you have to change and wrap like below.
#ifdef __cplusplus
extern
"C" {
#endif
__declspec(dllexport) int getValue(char c)
{
//some code
return 0;
}
#ifdef __cplusplus
};
#endif
Now recompile the program as a DLL and we are ready to call this function from C#.
So in your C# Application, first include
using System.Runtime.InteropServices;
Then add below line in the class file.
[DllImport("YourDllName.dll", CallingConvention = CallingConvention.StdCall)]
public static extern int getValue(char c);
After that you can call that function just like calling any C# function.
Eg: int i = getValue('a');
How to get a C++ struct from C#
Let's assume that you have a C++ function which returns a structure. And you need to get the returned C++ structure from the C# code. Here is how you should do it.
In the C++ code, the structure should look like this.
#pragma
pack(push, 8)
struct Location {
int x;
int y;
};
#pragma
pack(pop)
And assume that the C++ function (which returns the structure) looks like below,
__declspec(dllexport) Location getLocation(int a)
{
Location loc;
loc.x = 10;
loc.y = 20;
return loc;
}
So in the C# code, it should look like,
[DllImport("YourDllName.dll", CallingConvention = CallingConvention.StdCall)]
[return: MarshalAs(UnmanagedType.Struct)]
public static extern MyLocation startProcessing(int a);
[StructLayout(LayoutKind.Sequential)]
public struct MyLocation
{
public int x;
public int y;
}
Then you can call the C++ methid in C# like,
MyLocation loc = startProcessing(10);
Reference
http://msdn.microsoft.com/en-us/library/ms235282.aspx
http://msdn.microsoft.com/en-us/library/ms973872.aspx
http://msdn.microsoft.com/en-us/library/aa712982.aspx
http://msdn.microsoft.com/en-us/library/aa446536.aspx
http://msdn.microsoft.com/en-us/library/aa288468%28VS.71%29.aspx
http://msdn.microsoft.com/en-us/magazine/cc164123.aspx
http://msdn.microsoft.com/en-us/library/ms973872.aspx
http://msdn.microsoft.com/en-us/library/aa712982.aspx
http://msdn.microsoft.com/en-us/library/aa446536.aspx
http://msdn.microsoft.com/en-us/library/aa288468%28VS.71%29.aspx
http://msdn.microsoft.com/en-us/magazine/cc164123.aspx
If you have any issues, please add a comment so that I can help you as I can !
Labels:
.net,
C#,
C++,
pinvoke,
Platform Invoke
Thursday, March 25, 2010
After a long time
Hello Dear friends,
I was not able to update my blog for the past 10 months.
But stay tuned because there will be frequent blog posts from now on ...
I was not able to update my blog for the past 10 months.
But stay tuned because there will be frequent blog posts from now on ...
Thursday, March 26, 2009
My Final Year Project
These days i'm working on my final year project to complete my Software Engineering degree @ APIIT.
The topic of my FYP is "A Universal Translator for Mobile Phones". As soon as you here about the topic you may remember Start Wars because in those films there were inter-galactic translators to communicate with each aliens.
Ok, if i get back to my FYP, it will work as Speech -> Speech translator. It will be helpfull when you are in abroad and you can't speak or understand the local language.
Let's assume that you are in France and you only know how to speak/understand English but you need to talk with a French guy. So all you have to do is,
- Install my application in a mobile phone.
- Talk to the phone in 'English'.
- Then the phone will recognize what you spoke by using it's Speech Recognition Engine.
- So the sentence you spoke will be in text format.
- Then the phone will translate that sentence into 'French'.
- After that the translated text will be spoken by the phone in 'French' by using it's Text-to-Speech engine, so that the other guy can understand.
- This can be done vise-versa too so that you can understand French in English.
I think now you have a slight idea that it functions like,
Speech Recognition ==> Language Translation ==> Text to Speech.
There are many challenges I have to face in developing this,
- I'm building the application to work in an average mobile phone which is still not done yet. All the available solutions are for PDA's which runs Windows Mobile OS and has higher hardware specifications.
- Homophone Detection - A homophone is a word that is pronounced the same but differs in meaning (Eg. to,too,two) The speech recognition engine is not able to detect those errors. Eg. It may recognition "I need to go home" as "I need two go home" which is incorrect. So I came up with a 'Homophone Detection and Correction' algorithm which is AI based and use 'part of speech' tagging.
- Sentence recognition - Current speech recognition API's are only capable of recognizing a single word (a command). So i have to enhance the speech recognition to recognize sentences.
- Pronunciation modeling - A person can understand a sentence only if it is pronounced correctly. But still there are gaps in pronouncing (Text to Speech) in mobile computing. So I have to come up with a better and user understandable pronunciation mechanism.
Currently I have finished the research part and now in the design phase. Hope I'll complete it successfully.
Monday, March 02, 2009
Google Translate API for JavaME
I have created a JavaME (J2ME) client API to use Google Translate
in a mobile phone.
This project provides a simple API to use Google Translate in JavaME (J2ME) platform.
It uses the Google AJAX Language API to do the translation via a HTTP connection.
link: http://code.google.com/p/google-api-translate-javame/
The project is open source and under GPL v2 license.
Features: 40 supported languages , unicode support
Requirements: CLDC-1.1 MIDP-1.0

.
in a mobile phone.
This project provides a simple API to use Google Translate in JavaME (J2ME) platform.
It uses the Google AJAX Language API to do the translation via a HTTP connection.
link: http://code.google.com/p/google-api-translate-javame/
The project is open source and under GPL v2 license.
Features: 40 supported languages , unicode support
Requirements: CLDC-1.1 MIDP-1.0

.
Labels:
ajax,
FYP,
j2me,
java,
open source
Subscribe to:
Posts (Atom)

