hrishikeshrt / PyCDSL

Python Interface to Cologne Digital Sanskrit Lexicon (CDSL)
https://pypi.org/project/PyCDSL/
Other
12 stars 1 forks source link

search() command for CDSLCorpus class #15

Closed hrishikeshrt closed 2 years ago

hrishikeshrt commented 2 years ago

Consider adding these methods to CDSLCorpus class to facilitate usage like `CDSL.search('search-term', dict='MW') etc like usage as described in https://github.com/hrishikeshrt/PyCDSL/issues/12#issue-1125105666

I am not particularly fond of the usage regarding entry as requested in https://github.com/hrishikeshrt/PyCDSL/issues/12#issuecomment-1030753185 as I don't see a specific use case where this would be required. Entry numbers are not unique across dictionaries, so if one wants to query using entry ID, one also has a dictionary in mind, and in such case, one might as well do CDSL.dicts[dict_id].entry.

drdhaval2785 commented 2 years ago

I am also not fond of searching entry numbers across dictionaries. You can drop that part.

hrishikeshrt commented 2 years ago

As for a search() command for CDSLCorpus, when a specific dictionary is in mind, I would think that again by the same logic we should encourage the use of CDSL.dicts[dict_id].search() The real use for CDSLCorpus.search would be when one wants to search in multiple dictionaries. So, I think we should close this and track the issue in #14 instead.

drdhaval2785 commented 2 years ago

I am satisfied as long as the feature is available somewhere and documented properly. Then I can use it in my applications or programs.