|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object hu.birot.OTKit.performance.Production
public abstract class Production
This abstract class realizes the language production capacity of an agent. It has a single method, Production.produce(Grammar G, Form f), which maps any input form f to some output form, given the grammar G.
Usually, the input is either the null Form, from which G.base first generates some random message (and underlying form); or directly an underlying form. The output, in turn, is usually a surface form or an over form (after having applied G.utter to the surface form).
The mapping can be deterministic or stochastic, and using any type of grammars (OT, HG or something else). Concrete implementations are offered by the class ProductionExamples.
Constructor Summary | |
---|---|
Production()
|
Method Summary | |
---|---|
java.util.HashMap<Form,java.lang.Integer> |
distribution(Grammar G,
Form f,
int repetition)
The Production method produces sample of size repetition. |
java.lang.String |
frequency(Grammar G,
Form f,
int repetition)
A string containing the frequencies of a sample of size repetition. |
static double |
JSD(java.util.HashMap<Form,java.lang.Integer> D1,
java.util.HashMap<Form,java.lang.Integer> D2)
This static method returns the Jensen-Shannon divergence of two distributions. |
abstract Form |
produce(Grammar G,
Form f)
This method maps the input Form f to some output Form, based on the grammar G. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Production()
Method Detail |
---|
public abstract Form produce(Grammar G, Form f)
This method maps the input Form f to some output Form, based on the grammar G. The mapping can be deterministic or stochastic.
G
- Grammar to be used in the process of mapping.f
- Input form.
public java.lang.String frequency(Grammar G, Form f, int repetition)
A string containing the frequencies of a sample of size repetition. The Production method produces a surface form repetition times from underlying form f, employing grammar G. The frequencies obtained by this sampling process are reported in the form of a string. Each row has the form "form.toString : frequency".
G
- Grammar being used to produce a sample.f
- Underlying form from which surface forms are generated.repetition
- Sample size.
public java.util.HashMap<Form,java.lang.Integer> distribution(Grammar G, Form f, int repetition)
The Production method produces sample of size repetition. The sample reflect Grammar G and underlying form f.
G
- Grammar that is implemented by the Production method.f
- Underlying form from which surface forms are being produced.repetition
- Sample size.
public static double JSD(java.util.HashMap<Form,java.lang.Integer> D1, java.util.HashMap<Form,java.lang.Integer> D2)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |