spark集群使用hanlp进行分布式分词操作说明
本篇分享一个使用hanlp分词的操作小案例,即在spark集群中使用hanlp完成分布式分词的操作以下为全文: 分两步: 第一步:实现hankcs.hanlp/corpus.io.IIOAdapter 1. public class HadoopFileIoAdapter implements IIOAdapter { 2. 3.@Override 4.public InputStream open(String path) throws IOException { 5.Configuration conf = new Configuration(); 6.FileSystem fs = FileSystem.get(URI.create(path), conf); 7.return fs.open(new Path(path)); 8.} 9. 10.@Override 11.public OutputStream create(String path) throws IOException { 12.Configuration conf = new Configuratio...




