angeloskath/php-nlp-tools

Interfaces Move Into Separate Directory And Give Proper Name

yooper opened this issue · 3 comments

The interfaces in this library should all be placed into a single interfaces directory. The naming convention is not consistent across interfaces names.

A directory,"Interfaces" should be created in the NlpTools directory. All interface names should start with an I, as in IDocument, IStemmer, etc...

The accepted way in most large PHP projects is to append the keyword 'Interface' and the interfaces to reside in the correct namespace. The same goes with exceptions unless they are generic like invalid regex which isn't specific to any class, process etc. much like InvalidArgumentException.

I believe it won't change much the public api of the NlpTools to do such a change yet it requires time. I need to increase the test coverage (at least functional testing) to avoid issues like #6 and it will require changes in the documentation too.

So for now if you want to add a new interface add it in the same namespace as the classes that will be implementing it and add the keyword Interface afterwards. E.g.: NlpTools\Similarity\Similarity will be renamed to NlpTools\Similarity\SimilarityInterface

That sounds reasonable. We will follow the naming convention you provided.
If you need help with these issues and updating test cases let me know. I
am interested in this project to build my level of expertise within the NLP
domain, so I do not mind re-writing tests or adding more tests.

On Tue, Aug 27, 2013 at 10:39 AM, Angelos Katharopoulos <
notifications@github.com> wrote:

The accepted way in most large PHP projects is to append the keyword
'Interface' and the interfaces to reside in the correct namespace. The same
goes with exceptions unless they are generic like invalid regex which isn't
specific to any class, process etc. much like InvalidArgumentException.

I believe it won't change much the public api of the NlpTools to do such a
change yet it requires time. I need to increase the test coverage (at least
functional testing) to avoid issues like #6https://github.com/angeloskath/php-nlp-tools/issues/6and it will require changes in the documentation too.

So for now if you want to add a new interface add it in the same namespace
as the classes that will be implementing it and add the keyword Interface
afterwards. E.g.: NlpTools\Similarity\Similarity will be renamed to
NlpTools\Similarity\SimilarityInterface


Reply to this email directly or view it on GitHubhttps://github.com//issues/8#issuecomment-23341495
.

Tests are definitely very welcome. You can also improve your knowledge of the models by creating Functional or unit tests for any member of the NlpTools\Models namespace. Currently only the Lda model has a functional test.