Click here to Skip to main content
15,881,938 members
Please Sign up or sign in to vote.
1.00/5 (3 votes)
See more:
Hi,
I need program to convert greek numbers to english numbers and vice versa in objective-C language.
please anyone help me out in this..
Posted
Updated 7-Aug-12 2:16am
v3
Comments
JohnAspras 7-Aug-12 3:12am    
What is the Context ?
Richard MacCutchan 7-Aug-12 4:15am    
This is not a trivial problem. Do you have access to a dictionary, online or in your computer, with the words of each language (including variations)?
Sergey Alexandrovich Kryukov 7-Aug-12 12:52pm    
It does not require dictionary, if OP means the Greek numerals (http://en.wikipedia.org/wiki/Greek_numerals), this is just a mathematical problem, a bit complex in general case, but well... not as Poincaré conjecture :-)
It's pretty much as hard as with Latin numerals...
--SA
Richard MacCutchan 7-Aug-12 14:02pm    
OP's original question was just about converting between English and Greek, no mention of numbers.
Sergey Alexandrovich Kryukov 7-Aug-12 14:51pm    
If you look it now, you will see "numbers", so I answered accordingly.
--SA

1 solution

Look at this converter:
http://www.russellcottrell.com/greek/utilities/GreekNumberConverter.htm[^].

(Referenced from http://en.wikipedia.org/wiki/Greek_numerals[^], please see.)

This is all I could find. As far as I understand, it is fully written in JavaScript, so you can look at the page source and copy the algorithm to learn how it works. As I can see, it only function from integers to Greek numerals, but back parsing is actually easier, so you can created it.

If, by some reason, this is not enough or not exactly what you need (as I could see, there are different variants of Greek numerals), then, as I just said in my comment, you can see how integers are converted into Roman numerals and back. When you see and understand the implementation, you can adopt it for Greek numerals. This certainly will work. So, please see the external links to this article:
http://en.wikipedia.org/wiki/Roman_numerals#References[^].

Some algorithms are preserved in source code. They are simple enough (when someone has already written it for you, of course) to understand and adopt to your needs. You should not be confused by the fact it is not Objective-C. Very little code is written in Objective-C, compared to other languages, so you should be used to it. Besides, this is pure integer and string calculation, where the differences between languages and platforms are not really significant. It's all about the algorithm.

Good luck,
—SA
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900