aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--P1/src/mapper.c14
1 files changed, 2 insertions, 12 deletions
diff --git a/P1/src/mapper.c b/P1/src/mapper.c
index 8bbd2a6..3e0307d 100644
--- a/P1/src/mapper.c
+++ b/P1/src/mapper.c
@@ -78,18 +78,7 @@ while (root != NULL) {
// emit the <key, value> into intermediate DS
// eats the data into the DS
void emit(char *key, char *value) {
- //Go through intermediateDS, comparing key in list to *key.
- //If it exists, somehow add to the value list another "1" to the existing list.
- //If it never does (use string compare thing), add it to the end along with the "1".
-
- /* THIS IS NOT CURRENTLY IMPLEMENTED PROPERLY BUT SHOULD BE ABOUT RIGHT
- CONCEPTUALLY.
- intermediateDS *tempNode = NULL;
- while (root != NULL) {
- tempNode = root;
- root = root -> next;
- }
- */
+
}
// map function
@@ -98,6 +87,7 @@ void map(char *chunkData){
char *buffer;
while ((buffer = getWord(chunkData, &i)) != NULL){
// get words from buffer & give it to emitter to be put into intermediateDS
+ emit(buffer, "1");
}
// you can use getWord to retrieve words from the
// chunkData one by one. Example usage in utils.h