sego icon indicating copy to clipboard operation
sego copied to clipboard

Make segmenter load dictionary using github.com/wangkuiyi/fs

Open wangkuiyi opened this issue 9 years ago • 0 comments

Hi Hui,

Thank you for this great work of Chinese tokenizer!

I am open sourcing a distributed machine learning system, where thousands of processes using your tokenizer run on hundreds of computers. To make it easy for those processes to load the dictionary, it would be great if we can load the dictionary from HDFS. Also, loading from local filesystem is important for testing purpose. So I wrote github.com/wangkuiyi/fs and propose this two-line change to enable sego loading its dictionary from HDFS and local filesystem transparently.

I think an alternative solution to support transparency between HDFS and local filesystem is that sego load the dictionary from an io.Reader interface, so the caller can open whatever file streams and pass it to sego. This alternation doesn't rely sego on fs. What do you think about this? I am happy with either solution!

Thanks,

Yi

wangkuiyi avatar Dec 18 '15 04:12 wangkuiyi