[ 
https://issues.apache.org/jira/browse/OPENNLP-402?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13190767#comment-13190767
 ] 

Aliaksandr Autayeu commented on OPENNLP-402:
--------------------------------------------

I have improved class hierarchy and naming here. Now, the name follow the 
convention, interface and class hierarchy are parallel (aligned) and there is 
more logic in the package class structure. As a confirmation that this is the 
right way, some <Class> tricks were eliminated, which is a bonus :)

So, now:

CmdLineTool is the root interface, with two children: BasicCmdLineTool (for 
simple tools) and TypedCmdLineTool (for tools with formats and extra params 
like evaluators and trainers). There is a bunch of "basement" implementations, 
they all start with Abstract. AbstractCmdLineTool is the root one, with two 
children, AbstractBasicCmdLineTool (base class for simple tools) and 
AbstractTypedTool (for those with formats). AbstractTypedTool further 
specializes into AbstractTypedParamTool, which provides extra parameter support 
for its children, trainers and evaluators: AbstractTrainerTool and 
AbstractEvaluatorTool. And then there is the rest of the forest. 

See attached opennlp-cmdline-package-class-structure.png for more details.

I believe that after feedback on the last commit and testing, the issue now can 
be finally closed :) Guys, please, go ahead and give me some feedback. Joern, 
please, give it a look, you reviewed original refactoring, so might still 
remember the code. Thank you!
                
> CLI tools and formats refactored
> --------------------------------
>
>                 Key: OPENNLP-402
>                 URL: https://issues.apache.org/jira/browse/OPENNLP-402
>             Project: OpenNLP
>          Issue Type: Improvement
>          Components: Command Line Interface, Formats
>    Affects Versions: tools-1.5.3-incubating
>            Reporter: Aliaksandr Autayeu
>            Assignee: Aliaksandr Autayeu
>              Labels: patch
>         Attachments: 0016-CLI-tools-and-formats-refactored.patch, 
> 0017-added-direct-format-support-to-CLI-tools-and-formats.patch, 
> open-nlp-cli-package.png, opennlp-cmdline-package-class-structure.png
>
>
> Proposed patch refactors CLI tools and simplifies the code by introducing 
> hierarchy and removing a lot of code duplication. It also introduces better 
> error and help messages, including help for formats and listing available 
> formats in various tools, which are now able to work with formats directly. 
> This, in turn, eliminates the need to keep converted files on disk.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to