I've made a quick stab at turning kuroshiro (and kuroshiro-analyzer-kuromoji) sync, and I found that the dependency kuromoji has lag when building the data files so requires callback/promise when initialising kuroshiro/kuroshiro-analyzer-kuromoji -- since @hexenq stated that other analyzers need to be async (although I haven't looked at those analyzers nor do I know if they require async parse), this is not a blocking issue to going sync IMO.
My exploration was mainly to see if it is easy enough to change the kuroshiro.convert to sync (it is at least with kuroshiro-analyzer-kuromoji). I would maybe advocate for creating additional functions with a Sync suffix to separate between async and sync return output. Other analyzers will need to support synchronous parse (i.e. parseSync) since that's used within kuroshiro.convert method: https://github.com/hexenq/kuroshiro-analyzer-kuromoji/pull/6
In reference to #50 :
I've made a quick stab at turning kuroshiro (and kuroshiro-analyzer-kuromoji) sync, and I found that the dependency kuromoji has lag when building the data files so requires callback/promise when initialising kuroshiro/kuroshiro-analyzer-kuromoji -- since @hexenq stated that other analyzers need to be async (although I haven't looked at those analyzers nor do I know if they require async
parse
), this is not a blocking issue to going sync IMO.My exploration was mainly to see if it is easy enough to change the
kuroshiro.convert
to sync (it is at least with kuroshiro-analyzer-kuromoji). I would maybe advocate for creating additional functions with aSync
suffix to separate between async and sync return output. Other analyzers will need to support synchronousparse
(i.e.parseSync
) since that's used withinkuroshiro.convert
method: https://github.com/hexenq/kuroshiro-analyzer-kuromoji/pull/6