1: 2: 3:
4: 5: 6:
7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25:
| Input: POSSentence: Array // POS tagged set of sentences FormulatedEQN: String // Formulated Equation TypeOfProblem: String // Type of problem Intermediete: Word: Array // Part of a sentence IndvSente: Array // Individual sentence template Template: String // Intermediate template sentence Output: AMWTemplate: String // AMW problem template Begin: For i = 0 to sizeOf (POSSentence) IndvSente = POSSentence[i] For j = 0 to sizeOF (IndvSente) Word = SubElement[j] If Word[1] = ‘NNP’ Then Word[0] = append (‘AMHARICNAME’ + j) Else if Word[1] = ‘CD’ Then Word[0] = append (‘NUMBER’ + j) Else if j > 0 AND Word[1] = ’NNP’ Then Word[0] = append (‘ITEMNAME’ + j) Template = append (Template, Word) End For AMWTemplate = append (AMWTemplate, Template) End For AMWTemplate = append (AMWTemplate, FormulatedEQN) AMWTemplate = append (AMWTemplate, TypeOfProblem) Return (AMWTemplate) End |