Skip to content

VakarisL/OOP_5_AsocKont

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 

Repository files navigation

OOP_5_AsocKont

Actually Interesting Stuff

unordered_map

	std::unordered_map<std::string, std::set<line_number>> contents_;
	std::unordered_map<std::string, std::size_t> amount_;

Regular Expression (regex)

text::text(std::istream& input) {
	std::string temp_text;
	while (std::getline(input, temp_text)) {
		text_.push_back(temp_text);
		int line_numb = text_.size();
		std::string word;
		std::regex match("(([[:w:]]|[\x27])+)");
		std::sregex_token_iterator pos(temp_text.begin(), temp_text.end(), match);
		std::sregex_token_iterator end;
		while (pos != end) {
			word = pos->str();
			pos++;
			contents_[word].insert(line_numb);
			amount_[word]++;
		}
	}
}

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors