/// @file parser.cpp
/// The base parser class which defines a generic API for statistical parsers.
///
/// @author mouser
/// @date   2003.07.29
//---------------------------------------------------------------------------

//---------------------------------------------------------------------------
// Application includes
#include "parser.hpp"
//---------------------------------------------------------------------------




//---------------------------------------------------------------------------
bool OctaneParser::IsNonWordCharacter(unsigned char c)
{
	// return true if c is a non-word character, ie a delimiter between words
	// ATTN: this is a pretty inefficient function; we could use a static lookup table if we wanted to do this fast
	if (c==39)
		{
		// apostrophe
		return false;
		}
	else if (c<48)
		{
		// punctuation and nonprintables
		return true;
		}
	else if (c<58)
		{
		// digits
		return false;
		}
	else if (c<65)
		{
		// punctuation
		return true;
		}
	else if (c<91)
		{
		// uppercase
		return false;
		}
	else if (c<97)
		{
		// punctuation
		return true;
		}
	else if (c<123)
		{
		// lowercase
		return false;
		}
	else if (c<154)
		{
		// punctuation and nonprintables
		return true;
		}
	else
		{
		// ATTN: we've got some non-english characters here which mind form characters in other languages
		// for now we treat as word separators
		return true;
		}
}
//---------------------------------------------------------------------------



