An example tying documents, instreams, and parsing to count the number of document and non-unique symbols
int main(
int argc,
char *argv[])
{
try
{
filename = argv[1];
}
catch (...)
{
exit(printf("Cannot parse filename\n"));
}
size_t total_documents = 0;
size_t alphas = 0;
do
{
break;
total_documents++;
bool finished = false;
do
{
switch (token.type)
{
finished = true;
break;
alphas++;
break;
default:
break;
}
}
while (!finished);
}
printf("Documents:%lld\n", (long long)total_documents);
printf("alphas :%lld\n", (long long)alphas);
return 0;
}