open file // Use std::ifstream("/path/to/file")
if (file is open) { // Use std::ifstream::is_open()
while (not at end-of-file) { // Use std::ifstream::good()
read line from file // Use std::getline()
for (i from 0 to line.size()) {
if (line[i] is punctuation) // Use ispunct()
remove character at i from line // Use std::string::remove
}
if (line not in buffer)
append line to buffer // Use std::vector::push_back()
}
} else {
error
}