-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCombineTopicsMapper.java
42 lines (37 loc) · 1.26 KB
/
CombineTopicsMapper.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
/*=============================================================================
| Assignment: Final Project - Multiple Document Summarization
| Author: Group7 - (Sampath, Ajay, Visesh)
| Grader: Walid Shalaby
|
| Course: ITCS 6190
| Instructor: Srinivas Akella
|
| Language: Java
| Version : 1.8.0_101
|
| Deficiencies: No logical errors.
*===========================================================================*/
import java.io.IOException;
import org.apache.hadoop.io.IntWritable;
import org.apache.hadoop.io.LongWritable;
import org.apache.hadoop.io.Text;
import org.apache.hadoop.mapreduce.Mapper;
import edu.smu.tspell.wordnet.*;
import java.text.ParseException;
/**
* MapperClass to emit all the topics from different clusters , emitting the
* key and the current line.
*
*/
public class CombineTopicsMapper extends Mapper<LongWritable, Text, Text, Text> {
private final static IntWritable one = new IntWritable(1);
public void map(LongWritable offset, Text lineText, Context context) throws IOException, InterruptedException {
try {
String term = lineText.toString();
Text currlines = new Text(term);
context.write(new Text("Key"), currlines);
} catch (Exception ex) {
System.out.println(ex);
}
}
}