#ifndef _OTAny_h_
#define _OTAny_h_
/* OTAny.h; Paul Boersma, December 30, 1998 */

#ifndef _Collection_h_
	#include "Collection.h"
#endif
#ifndef _Graphics_h_
	#include "Graphics.h"
#endif
#ifndef _Strings_h_
	#include "Strings.h"
#endif

#include "OTAny_def.h"

/* OTConstraint */

#define OTConstraint_methods Data_methods
oo_CLASS_CREATE (OTConstraint, Data)

OTConstraint OTConstraint_create (int which, double ranking);

/* OTAnyGrammar */

#define OTAnyGrammar_members Data_members \
	Ordered constraints;
#define OTAnyGrammar_methods Data_methods \
	const char ** (*constraintNames) (I); \
	int (*evaluate) (I, int which, const char *input, const char *output, long icand_hint); \
	long (*gen) (I, thou, const char *input); \
	void (*generateInput) (I, char input []); \
	int (*locallyRanked) (I, int which1, int which2);
oo_CLASS_CREATE (OTAnyGrammar, Data)

OTAnyGrammar OTAnyGrammar_create (void *klas);
const char * OTAnyGrammar_constraintName (OTAnyGrammar me, int which);
int OTAnyGrammar_addConstraint (OTAnyGrammar me, int which, double ranking);
int OTAnyGrammar_evaluateConstraint (OTAnyGrammar me, int which, const char *input, const char *output, long icand_hint);

void OTAnyGrammar_generateOneInput (OTAnyGrammar me, char *input);
Strings OTAnyGrammar_generateInputs (OTAnyGrammar me, long n);
void OTAnyGrammar_sort (OTAnyGrammar me, double spreading);

int OTAnyGrammar_inputToOutput (OTAnyGrammar me, const char *input, char *output, double rankingSpreading);
Strings OTAnyGrammar_inputsToOutputs (OTAnyGrammar me, Strings inputs, double rankingSpreading);
Strings OTAnyGrammar_inputToOutputs (OTAnyGrammar me, const char *input, long n, double rankingSpreading);

int OTAnyGrammar_learnOne_ts (OTAnyGrammar me, const char *adultUnderlyingForm, const char *adultOutput);
int OTAnyGrammar_learn_ts (OTAnyGrammar me, Strings inputs, Strings outputs);

/* Strategies: */
#define OTAnyGrammar_DEMOTION_ONLY  0
#define OTAnyGrammar_SYMMETRIC_HIGHEST  1
#define OTAnyGrammar_SYMMETRIC_ALL  2
#define OTAnyGrammar_WEIGHTED_UNCANCELLED  3
#define OTAnyGrammar_WEIGHTED_ALL  4
int OTAnyGrammar_learnOne_mgla (OTAnyGrammar me, const char *adultUnderlyingForm, const char *adultOutput,
	double rankingSpreading, int strategy, int honourLocalRankings,
	double demotionMean, double relativeDemotionSpreading);
int OTAnyGrammar_learn_mgla (OTAnyGrammar me, Strings inputs, Strings outputs,
	double rankingSpreading, int strategy, int honourLocalRankings,
	double demotionMean, double relativeDemotionSpreading);

/* OTAnyTableau */

#define OTAnyTableau_methods Data_methods
oo_CLASS_CREATE (OTAnyTableau, Data)

OTAnyTableau OTAnyGrammar_to_Tableau (OTAnyGrammar me, const char *input);
long OTAnyTableau_getWinner (OTAnyTableau me);
void OTAnyTableau_draw (OTAnyTableau me, Graphics g);

/* End of file OTAny.h */
#endif
