/** @file persistent.h
 *
 *	Declaration of program "persistent" objects.
 *
 *	Persistent objects, as their name suggests, are alive from the program very
 *	beginning to its very end. They are kept within their own namespace. Almost
 *	all of program modules uses them (and that's why they are called persistent
 *	and declared as "global").
 *
 *	(C) Ceslav Przywara 2008, MFF UK Prague
 *
 */

#ifndef _PERSISTENT_H
#define _PERSISTENT_H

#include <map>

// Some base types needed.
#include "config.h"
// Morphologic and context filter
#include "filter.h"
// N-gram store
#include "ngrams.h"
// Overall stats
#include "stats.h"
// Strings store
#include "strings.h"

namespace ace {

/** Mapping between files and their morphologic filter related statistics.
 */
typedef std::map<std::string, Filter::Stats> morphologic_filter_file_stats_t;

/** Namespace holds (global) variables. As the name suggest, all objects within
 *	the namespace live till the program end.
 */
namespace persistent {
/** Lemmas strings are stored within this StringStore.
 */
extern StringStore<string_index_t> lemmas;
/** Morphological tags strings are stored within this StringStore.
 */
extern StringStore<tag_index_t> tags;
/** N-grams also have their own storage.
 */
extern NGramStore ngrams;
/** Morphologic filter is used to get rid of some not much interesting N-grams.
 */
extern MultiRulesFilter morphologic_filter;
/** Context filter is used to get rid of some not much interesting words.
 */
extern UniRulesFilter context_filter;
/** Overall statistics.
 */
extern stats_t overall_stats;
/** Morphologic filter has also some interesting statistics.
 */
extern morphologic_filter_file_stats_t morphologic_filter_file_stats;

} // namespace persistent

} // namespace ace

#endif
