/** @file dependencies.h
 *
 *	Declaration of dependency to string (and vice versa) convertion module.
 *
 *	This module is PDT corpus related. It provides conversion for all
 *	dependency types declared within PDT, in both directions:
 *	1. String to index (input datafile -> program memory).
 *	2. Index to string (program memory -> output datafile).
 *	Numeric indices are used because of smaller amount of memory they require.
 *
 *	(C) Ceslav Przywara 2008, MFF UK Prague
 *
 */

#ifndef _DEPENDENCY_H
#define _DEPENDENCY_H

// Strings are used within interface.
#include <string>

// Defines dependency_index_t type.
#include "config.h"

namespace ace {

/** Special namespace used to keep variables with indices of few special
 *	dependency values. These values must be named explicitly because
 *	the program access them directly.
 */
namespace dependency {
	/** Index of Head dependency.
	 */
	extern dependency_index_t head;
	/** Index of Undef dependency.
	 */
	extern dependency_index_t undef;
}

/** Converts given index to string representation of dependency value.
 *	Index must be valid! Otherwise some kind of range_error raises.
 *	@param dependency_index Index to be converted.
 *	@return String representation of given index.
 */
const char * dependency2cstring(dependency_index_t dependency_index);
/** Converts given string to index representation of dependency value.
 *	If given param is not found, special index (dependency::Undef) is returned.
 *	@param str String to be converted.
 *	@return Index representation of given string.
 */
dependency_index_t string2dependency(std::string& str);

} // namespace ace

#endif
