@Test public void testGetSystemLanguageModels() throws HmxException { final LookupLanguageModel model = new LookupLanguageModel("Greek", true); model.add(Arrays.asList(new SyntacticalFunction("Subj", "Subject", false, null), new SyntacticalFunction("S/P", "Subject-Predicate", false, null), new SyntacticalFunction("Voc", "Vocative", false, null))); model.add(Arrays.asList(new SyntacticalFunction("Pred", "Predicate", false, null))); model.add(Arrays.asList(new SyntacticalFunction("C", "Connector", true, null))); model.add(Arrays.asList(new SyntacticalFunction("Attr", "Attribute", false, null))); model.add(Arrays.asList(new SyntacticalFunction("GenO", "Genitive Object", false, null), new SyntacticalFunction("DatO", "Dative Object", false, null), new SyntacticalFunction("AccO", "Accusative Object", false, null), new SyntacticalFunction("PrepO", "Prepositional Object", false, null))); final List<AbstractSyntacticalFunctionElement> groups = new ArrayList<>(2); for (final String[] groupedType : new String[][] { new String[] { "Complement", "necessary" }, new String[] { "Adjunct", "erasable" } }) { final String type = groupedType[0]; final char firstChar = type.charAt(0); final List<AbstractSyntacticalFunctionElement> subTypes = new ArrayList<>(8); subTypes.add(new SyntacticalFunction("SId" + firstChar, "Subject-Indentification-" + type, false, null)); subTypes.add(new SyntacticalFunction("SMan" + firstChar, "Subject-Manner-" + type, false, null)); subTypes.add(new SyntacticalFunction("OId" + firstChar, "Object-Indentification-" + type, false, null)); subTypes.add(new SyntacticalFunction("OMan" + firstChar, "Object-Manner-" + type, false, null)); subTypes.add(new SyntacticalFunction("Loc" + firstChar, "Locale-" + type, false, null)); subTypes.add(new SyntacticalFunction("Time" + firstChar, "Time-" + type, false, null)); subTypes.add(new SyntacticalFunction("Mod" + firstChar, "Modal-" + type, false, null)); final List<SyntacticalFunction> subSubTypes = new ArrayList<>(7); subSubTypes.add(new SyntacticalFunction("Caus" + firstChar, "causal", false, null)); subSubTypes.add(new SyntacticalFunction("Cond" + firstChar, "conditional", false, null)); subSubTypes.add(new SyntacticalFunction("Cons" + firstChar, "consecutiv", false, null)); subSubTypes.add(new SyntacticalFunction("Fin" + firstChar, "final", false, null)); subSubTypes.add(new SyntacticalFunction("Conc" + firstChar, "concessiv", false, null)); subSubTypes.add(new SyntacticalFunction("Inst" + firstChar, "instrumental", false, null)); subSubTypes.add(new SyntacticalFunction("Int" + firstChar, "of interest", false, null)); subTypes.add(new SyntacticalFunctionGroup("Causal " + type, null, subSubTypes)); groups.add(new SyntacticalFunctionGroup(type, groupedType[1] + ", means\nnot requested by verb", subTypes)); } model.add(groups); final List<LanguageModel> systemModels = ModelParseServiceImplTest.parseService.getSystemLanguageModels(); Assert.assertEquals(2, systemModels.size()); this.assertLanguageModelEquals(model, systemModels.get(0)); Assert.assertEquals(model, systemModels.get(0)); }
public List<LanguageModel> getSystemLanguageModels() throws HmxException { final Map<String, Element> systemModelNodes = this.getSystemLanguageModelNodes(); final List<LanguageModel> result = new ArrayList<>(systemModelNodes.size()); for (final Element modelNode : systemModelNodes.values()) { final LookupLanguageModel model = this.parseLanguageModelFromXml(modelNode, modelNode.getAttribute(ModelParseServiceImpl.ATT_LANGMODEL_NAME), modelNode.getAttribute(ModelParseServiceImpl.ATT_LANGMODEL_ORIENTATION)); final LanguageModel incompatibleModel = new LanguageModel(model.getName(), model.isLeftToRightOriented()); incompatibleModel.setRecommendedFonts(model.getRecommendedFonts()); for (final List<AbstractSyntacticalFunctionElement> singleFunctionGroup : model.provideFunctions()) { incompatibleModel.add(this.removeBackwardCompatibilityInfo(singleFunctionGroup)); } result.add(incompatibleModel); } return result; }
ModelParseServiceImpl implements IModelParseService<Pericope> { public List<LanguageModel> getSystemLanguageModels() throws HmxException { final Map<String, Element> systemModelNodes = this.getSystemLanguageModelNodes(); final List<LanguageModel> result = new ArrayList<>(systemModelNodes.size()); for (final Element modelNode : systemModelNodes.values()) { final LookupLanguageModel model = this.parseLanguageModelFromXml(modelNode, modelNode.getAttribute(ModelParseServiceImpl.ATT_LANGMODEL_NAME), modelNode.getAttribute(ModelParseServiceImpl.ATT_LANGMODEL_ORIENTATION)); final LanguageModel incompatibleModel = new LanguageModel(model.getName(), model.isLeftToRightOriented()); incompatibleModel.setRecommendedFonts(model.getRecommendedFonts()); for (final List<AbstractSyntacticalFunctionElement> singleFunctionGroup : model.provideFunctions()) { incompatibleModel.add(this.removeBackwardCompatibilityInfo(singleFunctionGroup)); } result.add(incompatibleModel); } return result; } }
ModelParseServiceImpl implements IModelParseService<Pericope> { public List<LanguageModel> getSystemLanguageModels() throws HmxException { final Map<String, Element> systemModelNodes = this.getSystemLanguageModelNodes(); final List<LanguageModel> result = new ArrayList<>(systemModelNodes.size()); for (final Element modelNode : systemModelNodes.values()) { final LookupLanguageModel model = this.parseLanguageModelFromXml(modelNode, modelNode.getAttribute(ModelParseServiceImpl.ATT_LANGMODEL_NAME), modelNode.getAttribute(ModelParseServiceImpl.ATT_LANGMODEL_ORIENTATION)); final LanguageModel incompatibleModel = new LanguageModel(model.getName(), model.isLeftToRightOriented()); incompatibleModel.setRecommendedFonts(model.getRecommendedFonts()); for (final List<AbstractSyntacticalFunctionElement> singleFunctionGroup : model.provideFunctions()) { incompatibleModel.add(this.removeBackwardCompatibilityInfo(singleFunctionGroup)); } result.add(incompatibleModel); } return result; } @Inject  ModelParseServiceImpl(); }
ModelParseServiceImpl implements IModelParseService<Pericope> { public List<LanguageModel> getSystemLanguageModels() throws HmxException { final Map<String, Element> systemModelNodes = this.getSystemLanguageModelNodes(); final List<LanguageModel> result = new ArrayList<>(systemModelNodes.size()); for (final Element modelNode : systemModelNodes.values()) { final LookupLanguageModel model = this.parseLanguageModelFromXml(modelNode, modelNode.getAttribute(ModelParseServiceImpl.ATT_LANGMODEL_NAME), modelNode.getAttribute(ModelParseServiceImpl.ATT_LANGMODEL_ORIENTATION)); final LanguageModel incompatibleModel = new LanguageModel(model.getName(), model.isLeftToRightOriented()); incompatibleModel.setRecommendedFonts(model.getRecommendedFonts()); for (final List<AbstractSyntacticalFunctionElement> singleFunctionGroup : model.provideFunctions()) { incompatibleModel.add(this.removeBackwardCompatibilityInfo(singleFunctionGroup)); } result.add(incompatibleModel); } return result; } @Inject  ModelParseServiceImpl(); @Override List<ExportOption> getSupportedExports(); @Override Document parseXmlFromModel(final IModel<?> model, final List<?> openViewElements); Element parseXmlFromLanguageModel(final Document xml, final ISyntacticalFunctionProvider model); Element parseXmlFromRelationModel(final Document xml, final ISemanticalRelationProvider model); @Override Entry<Pericope, List<?>> parseModelFromXml(final Document xml, final File originPath); List<LanguageModel> getSystemLanguageModels(); List<LanguageModel> parseLanguageModelsFromXml(final Document xml); RelationModel getSystemRelationModel(); RelationModel parseRelationModelFromXml(final Document xml); }
ModelParseServiceImpl implements IModelParseService<Pericope> { public List<LanguageModel> getSystemLanguageModels() throws HmxException { final Map<String, Element> systemModelNodes = this.getSystemLanguageModelNodes(); final List<LanguageModel> result = new ArrayList<>(systemModelNodes.size()); for (final Element modelNode : systemModelNodes.values()) { final LookupLanguageModel model = this.parseLanguageModelFromXml(modelNode, modelNode.getAttribute(ModelParseServiceImpl.ATT_LANGMODEL_NAME), modelNode.getAttribute(ModelParseServiceImpl.ATT_LANGMODEL_ORIENTATION)); final LanguageModel incompatibleModel = new LanguageModel(model.getName(), model.isLeftToRightOriented()); incompatibleModel.setRecommendedFonts(model.getRecommendedFonts()); for (final List<AbstractSyntacticalFunctionElement> singleFunctionGroup : model.provideFunctions()) { incompatibleModel.add(this.removeBackwardCompatibilityInfo(singleFunctionGroup)); } result.add(incompatibleModel); } return result; } @Inject  ModelParseServiceImpl(); @Override List<ExportOption> getSupportedExports(); @Override Document parseXmlFromModel(final IModel<?> model, final List<?> openViewElements); Element parseXmlFromLanguageModel(final Document xml, final ISyntacticalFunctionProvider model); Element parseXmlFromRelationModel(final Document xml, final ISemanticalRelationProvider model); @Override Entry<Pericope, List<?>> parseModelFromXml(final Document xml, final File originPath); List<LanguageModel> getSystemLanguageModels(); List<LanguageModel> parseLanguageModelsFromXml(final Document xml); RelationModel getSystemRelationModel(); RelationModel parseRelationModelFromXml(final Document xml);  }