3食ラーメン(酢、味噌、塩) - 早朝の楽書きの本文を解析させてみると・・・
キーフレーズ抽出結果
上位の方は、いい線イッてるが
「いが家系」「初代けい」のあたりは、形態素解析がいまいちか。
辞書を自分でメンテナンスできたらいいな。
※ちなみにSen(ipadic-2.6.0)で形態素解析すると、そのあたりは
「家系」「初代」「けいすけ」と、特に違和感なく分かち書きできている。
3食ラーメン(酢、味噌、塩) - 早朝の楽書きの本文を解析させてみると・・・
キーフレーズ抽出結果
上位の方は、いい線イッてるが
「いが家系」「初代けい」のあたりは、形態素解析がいまいちか。
辞書を自分でメンテナンスできたらいいな。
※ちなみにSen(ipadic-2.6.0)で形態素解析すると、そのあたりは
「家系」「初代」「けいすけ」と、特に違和感なく分かち書きできている。
package org.apache.nutch.analysis.jp;
// JDK imports
import java.io.Reader;
// Lucene imports
import org.apache.lucene.analysis.Analyzer;
import org.apache.lucene.analysis.TokenStream;
// Nutch imports
import org.apache.nutch.analysis.NutchAnalyzer;
/**
* A simple Japanese Analyzer that wraps the Lucene one.
*/
public class JapaneseAnalyzer extends NutchAnalyzer {
private final static Analyzer ANALYZER =
new org.apache.lucene.analysis.ja.JapaneseAnalyzer();
/** Creates a new instance of JapaneseAnalyzer */
public JapaneseAnalyzer() {
}
public TokenStream tokenStream(String fieldName, Reader reader) {
return ANALYZER.tokenStream(fieldName, reader);
}
}
<?xml version="1.0"?>
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<project name="analysis-jp" default="jar-core">
<import file="../build-plugin.xml"/>
<!-- Build compilation dependencies -->
<target name="deps-jar">
<ant target="jar" inheritall="false" dir="../lib-lucene-analyzers"/>
</target>
<!-- Add compilation dependencies to classpath -->
<path id="plugin.deps">
<fileset dir="${nutch.root}/build">
<include name="**/lib-lucene-analyzers/*.jar" />
</fileset>
</path>
</project>
<?xml version="1.0" encoding="UTF-8"?> <plugin id="analysis-jp" name="Japanese Analysis Plug-in" version="1.0" provider-name="org.apache.nutch"> <runtime> <library name="analysis-jp.jar"> <export name="*" /> </library> <library name="lucene-ja.jar" /> <library name="sen.jar" /> </runtime> <requires> <import plugin="nutch-extensionpoints" /> </requires> <extension id="org.apache.nutch.analysis.jp" name="Japanese Analyzer" point="org.apache.nutch.analysis.NutchAnalyzer"> <implementation id="JapaneseAnalyzer" class="org.apache.nutch.analysis.jp.JapaneseAnalyzer"> <parameter name="lang" value="ja" /> </implementation> </extension> </plugin>
// doc.add("lang", lang);
doc.add("lang", "ja");

ほぼSen - 日本語形態素解析システムの手順通り。
SEN_HOME直下でのantは失敗するが、dicディレクトリでのant(辞書の構築)は成功。
Eclipseで問題なくStringTaggerDemo.javaが動いた。