-
Notifications
You must be signed in to change notification settings - Fork 196
Open
Description
Gathering together things that have been suggested over various issues and PRs:
- JSDoc types which work with TypeScript (maybe done or at least mostly there now?) e.g. https://github.com/snowballstem/snowball/pull/221/files/f72e3e890587d55861e181c7cc81292471985a11#diff-9a44c8895826a0b981973faa0f4b2f28f018aabfde923d03a406f2a47e82a9f8
- Allow selecting a stemmer by passing an ISO-639 code (https://github.com/clearlylocal/snowball/blob/esm/esm/core/getStemmerByLocale.mjs but that just hard-codes them all whereas they should be generated from
libstemmer/modules.txt) - Add ES6 Support with Classes and Closures for JavaScript #221 used
export defaultwhich seems to avoid the need to calculate the class name of the stemmer as well as the module name; the merged patch calculates both. - Currently Snowball externals are generated as private methods (so treated just like Snowball routines) and then a fixed
stemWord()public method is generated which sets the current word, calls#stem(), and returns the current word. This all seems a bit specific to the stemmers we ship rather than supporting the Snowball language in full. Conceptually wrong, but not all that important in practice. If there's a cleaner way to achieve this that would be nice though - e.g. we could apply the setting and getting of the current word to all externals and have a way to specify we want to map Snowballstemto JavascriptstemWord()(e.g.this.stemWord = this.stem;) - Add ES6 Support with Classes and Closures for JavaScript #221 Refactored
stemwords.jsto be fully async. Not entirely convinced that's helpful - at least to me it makes it harder to follow so worse in its partial role as an example of how to use the API, but maybe if you write a lot of JS async code it's actually easier to read in that form. It doesn't seem to be measurably faster as async either (it can probably parallelise IO with stemming a bit, but there is presumably extra overhead from the parallelism too). - Would it be better to pass
affromfind_amongto dispatch functions as a parameter: Emit JS classes #240 (comment)
Metadata
Metadata
Assignees
Labels
No labels