aramorph-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Aramorph-users] XML tables


From: Pierrick Brihaye
Subject: Re: [Aramorph-users] XML tables
Date: Fri, 19 Aug 2005 18:22:58 +0200
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; fr-FR; rv:1.7) Gecko/20040608

Hi,

Many answers to give :-)

Ahmed El-dawy a écrit :

     > 2. Is it accepted to add two classes: one for Dictionary and the
    other
     > for CompatabilityTable? This will make the XML parser much easier
    for
     > me. Also it will make the code easier to understand.

    Soryy. I don't understand what you mean here.

The InMemoryDictionaryHandler you made handles all work of dictionaries and compatability tables via Maps and Sets. My idea is building a class that handles the work of Dictionary, and another one for handling the work of CompatabilityTable.

OK. Good idea.

> For example, Dictionary class will contains
a method containsEntry(String) for checking of existence, and a method getIterator(String) for getting all entries with the given key. This will make parsing easier because each XML file will be mapped to an object.

OK.

I have attached one. I have just copied functions from InMemoryDictionaryHandler. I had to change access method to public because the interface cannot have a protected method. However, we can set them to package access (default).

OK. But :

1) remember that implementing classes should be singletons. The interface may so have a GetInstance() method.

2) I would like an init() method to pass, for example, a JDBCConnection.

3) we must have a LoadFromFile() method and maybe even a LoadFromXML.

4) rather then "translitered" arguments, consider Unicode ones. We may even have methods for both.

5) A good part of this code wil be common to every handler. That's why you should consider an AbstractDictionaryHandler (implementing DictionaryHandler) and then an InMemoryDictionaryHandler, a JDBCDictionaryHandler...

There may be other little details but, roughly, I agree with what you want to do.

    Don't use com.sun.* packages but *standard* ones (javax.*, org.*)
    because I want Aramorph to be buildable on any JVM in order to keep my
    Savannah hosting :-)

You are talking about the DOM class.

Yes.

I didn't found the classes I used in another package!!!

and

>
>     Furthermore don't use DocumentBuilderFactoryImpl, just
>     DocumentBuilderFactory : you shouldn't have access to the factory's
>     underlying implementation*s* ;-)
>
> I don't get your point. This part of code is copy & paste :). Can you
> send me the updated code to understand?


See http://64.18.163.122/rgagnon/javadetails/java-0481.html


    In the SAX file, the compatibility tables ares build using... DOM.

Sorry! I forgot to change it. I have changed it in the attached version.

OK ;-)

    When you process a string from the original dictionary, please give it
    as as a comment in the code (my fault if this has not been done
earlier).
Don't understand.

Give as a Java comment the string which is in the dictionary, e.g. :

Parsing a comment : ; conjunctions
Parsing unvocalized : w 
Parsing vocalized : wa  
Parsing morphological category : Pref-Wa        
Parsing gloss and grammatical category : and <pos>wa/CONJ+</pos>
        
etc, etc. It will be useful for the bloody GlossPOS ;-)

Oh, one more important thing I would like you to do. To remain ASCII compliant, use the Java \uXXXXsyntax for arabic characters. Aramorph must comple even on computers that don't support arabic.

Please try to revise the SAX transformer. I will start working in the parser right now.

I'll do it ASAP.

Cheers,

p.b.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]