|
PLearn 0.1
|
#include <plearn/base/general.h>
Go to the source code of this file.
Functions | |
| bool | isLetter (char c) |
| bool | isDigit (char c) |
| bool | isAlpha (char c) |
| bool | isPunctuation (string word) |
| int | main (int argc, char **argv) |
| bool isAlpha | ( | char | c | ) |
Definition at line 17 of file punctuation_filter.cc.
References PLearn::isDigit(), and PLearn::isLetter().

| bool isDigit | ( | char | c | ) |
Definition at line 12 of file punctuation_filter.cc.
| bool isLetter | ( | char | c | ) |
| bool isPunctuation | ( | string | word | ) |
Definition at line 22 of file punctuation_filter.cc.
References i, and PLearn::isAlpha().

Definition at line 31 of file punctuation_filter.cc.
References PLearn::endl(), isPunctuation(), and PLERROR.
{
if (argc != 1)
PLERROR("usage : punctuation_filter < in.text > filtered_out.text");
string word;
while (true)
{
cin >> word;
if (!cin) break;
if (isPunctuation(word))
//cout << "<punctuation>" << " : " << word << endl;
cout << "<punctuation>" << endl;
else
cout << word << endl;
}
}

1.7.4