Commit 4701db3c authored by YUSHIQIAN's avatar YUSHIQIAN

word co-occurence pair modify mapper

parent c3970aba
......@@ -34,9 +34,12 @@ public class Pair extends Configured implements Tool {
@Override
public void map(LongWritable inKey, Text inValue, Context context)throws IOException, InterruptedException {
String line = inValue.toString();
line = line.replaceAll(pattern, " ");
line = line.toLowerCase();
String[] str = line.split(" +");
//line = line.replaceAll(pattern, " ");
//line = line.toLowerCase()
//String[] str = line.split(" +");
String[] str = line.split("\\s+");
for(int i=0; i< str.length-1; i++)
{
word0.set(str[i]);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment