zemberek-nlp icon indicating copy to clipboard operation
zemberek-nlp copied to clipboard

Add a new Facade class for easier access to zemberek functionality.

Open mdakin opened this issue 8 years ago • 1 comments

I think we need a new Facade class for easier access to Zemberek functionality. It should be super easy to use Zemberek. It is already quite easy, but a central access point with reasonable defaults makes the project more approachable.

Strawman proposal: Facade class: Turkish Turkish tr = Turkish.withDefaults();

However it is trickier for providing further functionality, for example, for analyze it could work on words, sentences or documents (for one or multiple)

tr.analyze(String input...) tr.analyzeWord(String input...) tr.analyzeSentence(String input...) ..

or should it work on a class (e.g. WorkItem)s that encapsulates the input? w=WorItem.forSentence(String s); tr.analyze(WorkItem w)?

This class should also work with only flags from command line.

mdakin avatar Feb 03 '17 15:02 mdakin

This will require some experimentation.

There are some issues for such a facade class. Such as

  • In future some functions may require very large in memory models. So a way of lazy loading and perhaps releasing may be required. Otherwise simple operations (like tokenization) memory and instantiation suffer.
  • Also which module will this class belong to? Perhaps for now we should experiment in experiment module for ease of use and do not distribute that module in releases.

Another usage alternative is

tr.analyzer.analyzeWord() tr.analyzer.analyzeSentence() tr.tokenizer.tokenize()

etc.

ahmetaa avatar Feb 03 '17 19:02 ahmetaa