WordFreq
Public Member Functions | Friends | List of all members
Parser Class Reference

Parser class that tokenizes words and removes special characters. More...

#include <parser.h>

Collaboration diagram for Parser:
Collaboration graph

Public Member Functions

 Parser (const std::string &path, std::map< std::string, size_t > *globalFreqencyMap=nullptr)
 Initializes a Parser with an input and export file. More...
 
bool parse ()
 A function that creates a file stream from a path and parses it for word frequency. More...
 
void exportToFile ()
 A function that exports the per parser frequency map. More...
 

Friends

std::ostream & operator<< (std::ostream &out, const Parser &aDis)
 

Detailed Description

Parser class that tokenizes words and removes special characters.

This class tokenizes words, counts word frequency and stores them alphabetically in an in-memory data store.

Constructor & Destructor Documentation

◆ Parser()

Parser::Parser ( const std::string &  path,
std::map< std::string, size_t > *  globalFreqencyMap = nullptr 
)

Initializes a Parser with an input and export file.

Member Function Documentation

◆ exportToFile()

void Parser::exportToFile ( )

A function that exports the per parser frequency map.

◆ parse()

bool Parser::parse ( )

A function that creates a file stream from a path and parses it for word frequency.

Returns
the status of whether parsing was successful.

Friends And Related Function Documentation

◆ operator<<

std::ostream& operator<< ( std::ostream &  out,
const Parser aDis 
)
friend

The documentation for this class was generated from the following files: