xom-interest AT lists.ibiblio.org
Subject: XOM API for Processing XML with Java
List archive
Re: [XOM-interest] I am new to XOM, can I create and read XML documents that contains Japnese characters? Please reply soon, URGENT!! Thanks!
- From: Angela Amoateng <angela.amoateng AT kcl.ac.uk>
- To: xom-interest AT lists.ibiblio.org
- Subject: Re: [XOM-interest] I am new to XOM, can I create and read XML documents that contains Japnese characters? Please reply soon, URGENT!! Thanks!
- Date: Sun, 20 May 2007 17:35:57 +0100
Hi Grezegorz,
Thanks for getting back to me so quickly!!
So XOM can read Hiragana, thats great! Will it be using UTF-8 encoding?
Unfortunately, I am not allowed to implement an existing dictionary, it
will be seen as cheating! However, I do not have to do a full
dictionary, I just have to be able to demonstrate the ability to
translate the words. For example, if I can translate 10 words that are
stored in the XML, then technically, I can translate 100 words!
Ok, what about this solution?
Is there any way of me having a list of 10 English words, which has its
equivalent Japanese words within elements, probably storing the words
as element content. So ten elements will store the dual data, the
English and Japanese words.
Can then XOM scan the list, after being given the string input from a
Java GUI? (I would retrieve the string written in the JTextfield and
pass it to XOM.. what method would I use to do that?)
When XOM scans the list and finds the matching word, it would return
the value of its Japanese or English equivalent, which will then be
printed out in a new JTextField?
Please let me know if this is possible?
Thanks!
Angela
Quoting Grzegorz Kaczor <grzegorz.kaczor AT gmail.com>:
Hi Angela,
I think you just need to implement some kind of dictionary in Java and
any XML document model will be of limited help here :).
1) AFAIK Hiragana is part of BMP (Basic Multilingual Plane) so XOM, as
well as any other XML parser (and Java in general) should handle it as
well as any other Unicode BMP script.
http://en.wikipedia.org/wiki/Mapping_of_Unicode_characters#Basic_Multilingual_Plane
2) You can create that document, by parsing the dictionary files and
building them using XOM. However, usability of it is doubtful to me.
3) You can do it using XPath //entry[@word='apple'] or similar.
Anyway, I think that you can use XOM to read your document into memory
and then use two hash tables to implement translations in both
directions. If the dictionary is big it will be more efficient than
XPath. And it is easy, clear and fast to implement.
Regards,
Grzegorz
On 20/05/07, Angela Amoateng <angela.amoateng AT kcl.ac.uk> wrote:
Hi all at XOM,
I discovered this form of Java API from a book "Learn Java in 24 hours"
and I like what I see!
I am a computer science student at King's College London, University of
London and I am currently building a system using Java and XML(an
English to Japanese translator and tutor) for my final year project and
I have a TIGHT DEADLINE! I am good at Java, but I am new to XML,
although I am aware of how DOM level 1 and SAX works.
In my project, one XML document, will have a list of English words and
phrases with their Japanese translation and in another XML document I
will have a list of Japanese words and phrases with the English
translation.
I would like to know if three things are possible using the XOM model:
1)Does the XOM model recognise and create an XML document containing
Japanese characters, specifically Hiragana? How will I go about this?
2) Can I create an XML document using XOM model, that will enable me to
have an "EqualsTo" function for each word. For example, "apple" in
Japanese is "ringo" so:
<word>apple = ringo <word>
3) Also, if a string input (which would be a word of Japanese or
English) from a Java GUI is entered, that string input could be
compared to the list of words in the XML document and return the value
it equals to. For example, if the user enters "apple" in a JTextfield,
it will return the value "ringo"
I hope you can answer this for me!! Thanks!!
Angela
--
Angela Amoateng
angela.amoateng AT kcl.ac.uk
_______________________________________________
XOM-interest mailing list
XOM-interest AT lists.ibiblio.org
http://lists.ibiblio.org/mailman/listinfo/xom-interest
--
"Choć tyle wiemy własnym doświadczeniem:
W nas jest Raj, Piekło - i do obu - szlaki."
J.K.
--
Angela Amoateng
angela.amoateng AT kcl.ac.uk
----- End forwarded message -----
--
Angela Amoateng
angela.amoateng AT kcl.ac.uk
- Re: [XOM-interest] I am new to XOM, can I create and read XML documents that contains Japnese characters? Please reply soon, URGENT!! Thanks!, Angela Amoateng, 05/20/2007
Archive powered by MHonArc 2.6.24.