public StringTuple(String[] entries) { for (String entry : entries) { add(entry); } }
public StringTuple(String firstEntry) { add(firstEntry); }
public StringTuple(Iterable<String> entries) { for (String entry : entries) { add(entry); } }
public StringTuple(String[] entries) { for (String entry : entries) { add(entry); } }
public StringTuple(Iterable<String> entries) { for (String entry : entries) { add(entry); } }
public StringTuple(String[] entries) { for (String entry : entries) { add(entry); } }
public StringTuple(Iterable<String> entries) { for (String entry : entries) { add(entry); } }
public StringTuple(String firstEntry) { add(firstEntry); }
public StringTuple(String firstEntry) { add(firstEntry); }
@Override protected void map(Text key, Text value, Context context) throws IOException, InterruptedException { TokenStream stream = analyzer.tokenStream(key.toString(), new StringReader(value.toString())); CharTermAttribute termAtt = stream.addAttribute(CharTermAttribute.class); stream.reset(); StringTuple document = new StringTuple(); while (stream.incrementToken()) { if (termAtt.length() > 0) { document.add(new String(termAtt.buffer(), 0, termAtt.length())); } } stream.end(); Closeables.close(stream, true); context.write(key, document); }
@Override protected void map(Text key, Text value, Context context) throws IOException, InterruptedException { TokenStream stream = analyzer.tokenStream(key.toString(), new StringReader(value.toString())); CharTermAttribute termAtt = stream.addAttribute(CharTermAttribute.class); stream.reset(); StringTuple document = new StringTuple(); while (stream.incrementToken()) { if (termAtt.length() > 0) { document.add(new String(termAtt.buffer(), 0, termAtt.length())); } } stream.end(); Closeables.close(stream, true); context.write(key, document); }
@Override protected void map(WritableComparable<?> key, VectorWritable value, Context context) throws IOException, InterruptedException { String keyName; Vector valVec = value.get(); if (valVec instanceof NamedVector) { keyName = ((NamedVector) valVec).getName(); } else { keyName = key.toString(); } for (NamedVector seedVector : seedVectors) { double distance = measure.distance(seedVector, valVec); if (!usesThreshold || distance <= maxDistance) { StringTuple outKey = new StringTuple(); outKey.add(seedVector.getName()); outKey.add(keyName); context.write(outKey, new DoubleWritable(distance)); } } }
@Override protected void map(Text key, Text value, Context context) throws IOException, InterruptedException { TokenStream stream = analyzer.tokenStream(key.toString(), new StringReader(value.toString())); CharTermAttribute termAtt = stream.addAttribute(CharTermAttribute.class); stream.reset(); StringTuple document = new StringTuple(); while (stream.incrementToken()) { if (termAtt.length() > 0) { document.add(new String(termAtt.buffer(), 0, termAtt.length())); } } stream.end(); Closeables.close(stream, true); context.write(key, document); }
@Override protected void map(WritableComparable<?> key, VectorWritable value, Context context) throws IOException, InterruptedException { String keyName; Vector valVec = value.get(); if (valVec instanceof NamedVector) { keyName = ((NamedVector) valVec).getName(); } else { keyName = key.toString(); } for (NamedVector seedVector : seedVectors) { double distance = measure.distance(seedVector, valVec); if (!usesThreshold || distance <= maxDistance) { StringTuple outKey = new StringTuple(); outKey.add(seedVector.getName()); outKey.add(keyName); context.write(outKey, new DoubleWritable(distance)); } } }
@Override protected void map(WritableComparable<?> key, VectorWritable value, Context context) throws IOException, InterruptedException { String keyName; Vector valVec = value.get(); if (valVec instanceof NamedVector) { keyName = ((NamedVector) valVec).getName(); } else { keyName = key.toString(); } for (NamedVector seedVector : seedVectors) { double distance = measure.distance(seedVector, valVec); if (!usesThreshold || distance <= maxDistance) { StringTuple outKey = new StringTuple(); outKey.add(seedVector.getName()); outKey.add(keyName); context.write(outKey, new DoubleWritable(distance)); } } }
StringTuple inputTuple = new StringTuple(); for (String i : input) { inputTuple.add(i);
StringTuple inputTuple = new StringTuple(); for (String i : input) { inputTuple.add(i);