ocarina/include/core/filter.h

43 lines
966 B
C
Raw Normal View History

/**
* @file
* Copyright 2013 (c) Anna Schumaker.
*/
#ifndef OCARINA_CORE_FILTER_H
#define OCARINA_CORE_FILTER_H
#include <set>
#include <string>
/**
* Namespace for searching the tag database.
*/
namespace filter {
/**
* Break a string into words and add each word to an index.
*
* @param text The text to parse.
* @param id An identifier paired with the text.
* @return The lowercase form of the input text.
*/
std::string add(const std::string &, unsigned int);
/**
* Search the entire index for identifiers paired with the input text.
*
* @param text The text to search for.
* @param res The results set will be filled in with the ids found.
*/
void search(const std::string &, std::set<unsigned int> &);
/**
* Returns the lowercase version of the input text.
*
* @param text The text to be converted into lowercase.
*/
std::string lowercase(const std::string &);
};
#endif /* OCARINA_CORE_FILTER_H */