I built a new addition to the analysis of Arabic names in Palantir's system.
Arabic Names Analysis
In the helperFactory class that contains the main controls and buttons. there is new controls to handle the results. And there is new button named (Analysis) to handle the user event . when the event is fired it calls the next procedure (doAnalyse)
doAnalyse() : this is the main procedure that calls the remaining functions.
it takes the writtin text and calls the language opposition procedure, then the sex type procedure will be called on the resulted word to determine the type (male or female). Then the work derivations will be extracted by calling the derivations procedure. Finally the meaning procedure is called to get the word meaning.These four procedures are grouped in the AnalysisManager.
AnalysisManager : this class contains four procedures :
- isFemale(String name): determines if the name is belong to male or female.
- languageOpposition(String name): to get the translation of the word in the opposite language (if the argument is wriiten in English it returns it in the Arabic).
- processDerivations(String name): to get the word derivations
- processMeaning(String name): to get the word meaning the previous procedure use another procedures to access XML files and get the translation and derivations and meaning. These procedures are grouped in the XmlManager
XmlManager: contains the following procedures:
- parseTranslation(InputStream): this procedure parses the translation.xml file to map the words and their oppositions .
- getTranslation(String) : to get the word translation to return it to the languageOpposition procedure.
- parseDerivations(InputSream): to parse the ArQuery.xml to use it in the processDerivations procedure to get the name derivations.
- parseMeaning(InputSream) : to parse the name.xml file to use it in the processMeaning procedure to get the name meaning.
- fillMap(): helper procedure in the xml parsing
- getBytesFromFile(): to convert the file to array of bytes.
(https://docs.palantir.com/pg/18.104.22.168/wwhelp/wwhimpl/js/html/wwhelp.htm#href=devguide/custom-code-setup.02.4.html) (https://docs.palantir.com/pg/22.214.171.124/wwhelp/wwhimpl/js/html/wwhelp.htm#href=devguide/helloworld.03.2.html) (https://docs.palantir.com/pg/126.96.36.199/wwhelp/wwhimpl/js/html/wwhelp.htm#href=devguide/helloworld.03.1.html)
Note I can't test the plugin because I do not have the Palantir platform.