本文整理汇总了Java中simplenlg.phrasespec.NPPhraseSpec.setSpecifier方法的典型用法代码示例。如果您正苦于以下问题:Java NPPhraseSpec.setSpecifier方法的具体用法?Java NPPhraseSpec.setSpecifier怎么用?Java NPPhraseSpec.setSpecifier使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类simplenlg.phrasespec.NPPhraseSpec
的用法示例。
在下文中一共展示了NPPhraseSpec.setSpecifier方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: testEx17
import simplenlg.phrasespec.NPPhraseSpec; //导入方法依赖的package包/类
@Test
public void testEx17() {
NPPhraseSpec np = this.phraseFactory.createNounPhrase("que");
VPPhraseSpec vp = this.phraseFactory.createVerbPhrase("instalar");
np.setFeature(Feature.NUMBER, NumberAgreement.PLURAL);
vp.setFeature(Feature.TENSE, Tense.PAST);
vp.setFeature(Feature.PASSIVE, true);
PPPhraseSpec pp = this.phraseFactory.createPrepositionPhrase("ao longo de");
NPPhraseSpec np2 = this.phraseFactory.createNounPhrase("calçadão");
np2.setSpecifier("o");
pp.addComplement(np2);
vp.addPostModifier(pp);
SPhraseSpec s = this.phraseFactory.createClause(np, vp);
Assert.assertEquals("Que foram instalados ao longo do calçadão.", getResult(s));
}
示例2: testEx17b
import simplenlg.phrasespec.NPPhraseSpec; //导入方法依赖的package包/类
@Test
public void testEx17b() {
NPPhraseSpec np = this.phraseFactory.createNounPhrase("que");
VPPhraseSpec vp = this.phraseFactory.createVerbPhrase("instalar");
np.setFeature(Feature.NUMBER, NumberAgreement.PLURAL);
vp.setFeature(Feature.TENSE, Tense.IMPERFECT);
vp.setFeature(Feature.PERFECT, true);
PPPhraseSpec pp = this.phraseFactory.createPrepositionPhrase("ao longo de");
NPPhraseSpec np2 = this.phraseFactory.createNounPhrase("calçadão");
np2.setSpecifier("o");
pp.addComplement(np2);
vp.addPostModifier(pp);
SPhraseSpec s = this.phraseFactory.createClause(np, vp);
Assert.assertEquals("Que tinham instalado ao longo do calçadão.", getResult(s));
}
示例3: testEx17c
import simplenlg.phrasespec.NPPhraseSpec; //导入方法依赖的package包/类
@Test
public void testEx17c() {
NPPhraseSpec np = this.phraseFactory.createNounPhrase("que");
VPPhraseSpec vp = this.phraseFactory.createVerbPhrase("instalar");
np.setFeature(Feature.NUMBER, NumberAgreement.PLURAL);
vp.setFeature(Feature.TENSE, Tense.PAST);
vp.setFeature(Feature.PROGRESSIVE, true);
PPPhraseSpec pp = this.phraseFactory.createPrepositionPhrase("ao longo de");
NPPhraseSpec np2 = this.phraseFactory.createNounPhrase("calçadão");
np2.setSpecifier("o");
pp.addComplement(np2);
vp.addPostModifier(pp);
SPhraseSpec s = this.phraseFactory.createClause(np, vp);
Assert.assertEquals("Que estiveram instalando ao longo do calçadão.", getResult(s));
}
示例4: testEx01
import simplenlg.phrasespec.NPPhraseSpec; //导入方法依赖的package包/类
@Test
public void testEx01() {
NPPhraseSpec subject = this.phraseFactory.createNounPhrase("eles");
NPPhraseSpec object = this.phraseFactory.createNounPhrase("receita");
object.setFeature(Feature.NUMBER, NumberAgreement.PLURAL);
object.setSpecifier("as");
SPhraseSpec s = this.phraseFactory.createClause(subject, "trazer", object);
s.setFeature(Feature.TENSE, Tense.PAST);
Assert.assertEquals("Eles trouxeram as receitas.", getResult(s));
}
示例5: testEx04
import simplenlg.phrasespec.NPPhraseSpec; //导入方法依赖的package包/类
@Test
public void testEx04() {
// TODO it should be possible to pack the subject "quem gosta" within
// a VP instead of within an NP, as it is. Something in the French
// grammar messes with the syntax if one does this.
NPPhraseSpec subject = this.phraseFactory.createNounPhrase("quem gosta");
NPPhraseSpec object = this.phraseFactory.createNounPhrase("capela");
object.setSpecifier("a");
SPhraseSpec s = this.phraseFactory.createClause(subject, "visitar", object);
s.setFeature(Feature.MODAL, "dever");
Assert.assertEquals("Quem gosta deve visitar a capela.", getResult(s));
}
示例6: testEx05
import simplenlg.phrasespec.NPPhraseSpec; //导入方法依赖的package包/类
@Test
public void testEx05() {
NPPhraseSpec subject = this.phraseFactory.createNounPhrase("morador");
subject.setSpecifier("os");
subject.setFeature(Feature.NUMBER, NumberAgreement.PLURAL);
NPPhraseSpec object = this.phraseFactory.createNounPhrase("cidade");
object.setSpecifier("a");
SPhraseSpec s = this.phraseFactory.createClause(subject, "atravessar", object);
s.setFeature(Feature.MODAL, "precisar");
Assert.assertEquals("Os moradores precisam atravessar a cidade.", getResult(s));
}
示例7: testEx06
import simplenlg.phrasespec.NPPhraseSpec; //导入方法依赖的package包/类
@Test
public void testEx06() {
PPPhraseSpec pp = this.phraseFactory.createPrepositionPhrase("de");
pp.addPreModifier("a cinco quadras");
NPPhraseSpec np = this.phraseFactory.createNounPhrase("torre");
np.setSpecifier("a");
pp.addComplement(np);
SPhraseSpec s = this.phraseFactory.createClause(null, "ficar", pp);
Assert.assertEquals("Fica a cinco quadras da torre.", getResult(s));
}
示例8: testEx07
import simplenlg.phrasespec.NPPhraseSpec; //导入方法依赖的package包/类
@Test
public void testEx07() {
PPPhraseSpec pp = this.phraseFactory.createPrepositionPhrase("a");
NPPhraseSpec np = this.phraseFactory.createNounPhrase("direita");
np.setSpecifier("a");
pp.addComplement(np);
SPhraseSpec s = this.phraseFactory.createClause(null, "virar", pp);
s.setFeature(Feature.TENSE, Tense.IMPERATIVE);
Assert.assertEquals("Vire à direita.", getResult(s));
}
示例9: testEx08
import simplenlg.phrasespec.NPPhraseSpec; //导入方法依赖的package包/类
@Test
public void testEx08() {
NPPhraseSpec np = this.phraseFactory.createNounPhrase("prato");
np.setSpecifier("vários");
np.setFeature(Feature.NUMBER, NumberAgreement.PLURAL);
PPPhraseSpec pp = this.phraseFactory.createPrepositionPhrase("a");
NPPhraseSpec np2 = this.phraseFactory.createNounPhrase("mesa");
np2.setSpecifier("a");
pp.addComplement(np2);
np.addComplement(pp);
Assert.assertEquals("Vários pratos à mesa.", getResult(np));
}
示例10: testEx09
import simplenlg.phrasespec.NPPhraseSpec; //导入方法依赖的package包/类
@Test
public void testEx09() {
NPPhraseSpec np = this.phraseFactory.createNounPhrase("quem gosta");
NPPhraseSpec np2 = this.phraseFactory.createNounPhrase("ponte");
np2.setSpecifier("a");
SPhraseSpec s = this.phraseFactory.createClause(np, "cruzar", np2);
s.setFeature(Feature.MODAL, "poder");
Assert.assertEquals("Quem gosta pode cruzar a ponte.", getResult(s));
}
示例11: testEx10
import simplenlg.phrasespec.NPPhraseSpec; //导入方法依赖的package包/类
@Test
public void testEx10() {
NPPhraseSpec np = this.phraseFactory.createNounPhrase("proximidade");
np.setSpecifier("a");
PPPhraseSpec pp = this.phraseFactory.createPrepositionPhrase("com");
NPPhraseSpec np2 = this.phraseFactory.createNounPhrase("natureza");
np2.setSpecifier("a");
pp.addComplement(np2);
np.addComplement(pp);
Assert.assertEquals("A proximidade com a natureza.", getResult(np));
}
示例12: testEx11
import simplenlg.phrasespec.NPPhraseSpec; //导入方法依赖的package包/类
@Test
public void testEx11() {
VPPhraseSpec vp = this.phraseFactory.createVerbPhrase("descer");
vp.setFeature(Feature.TENSE, Tense.IMPERSONAL_INFINITIVE);
NPPhraseSpec np = this.phraseFactory.createNounPhrase("serra");
np.setSpecifier("a");
vp.addComplement(np);
PPPhraseSpec pp = this.phraseFactory.createPrepositionPhrase("depois de");
pp.addComplement(vp);
Assert.assertEquals("Depois de descer a serra.", getResult(pp));
}
示例13: testEx13
import simplenlg.phrasespec.NPPhraseSpec; //导入方法依赖的package包/类
@Test
public void testEx13() {
NPPhraseSpec np = this.phraseFactory.createNounPhrase("calçadão");
np.setSpecifier("o");
VPPhraseSpec vp = this.phraseFactory.createVerbPhrase("começar");
AdvPhraseSpec ap = this.phraseFactory.createAdverbPhrase("ali");
SPhraseSpec s = this.phraseFactory.createClause(np, vp, ap);
Assert.assertEquals("O calçadão começa ali.", getResult(s));
}
示例14: testEx14
import simplenlg.phrasespec.NPPhraseSpec; //导入方法依赖的package包/类
@Test
public void testEx14() {
NPPhraseSpec np = this.phraseFactory.createNounPhrase("teatro");
np.setSpecifier("o");
VPPhraseSpec vp = this.phraseFactory.createVerbPhrase("ficar");
AdvPhraseSpec ap = this.phraseFactory.createAdverbPhrase("ali");
SPhraseSpec s = this.phraseFactory.createClause(np, vp, ap);
Assert.assertEquals("O teatro fica ali.", getResult(s));
}
示例15: testEx15
import simplenlg.phrasespec.NPPhraseSpec; //导入方法依赖的package包/类
@Test
public void testEx15() {
VPPhraseSpec vp = this.phraseFactory.createVerbPhrase("levar");
vp.setFeature(Feature.TENSE, Tense.IMPERSONAL_INFINITIVE);
NPPhraseSpec np = this.phraseFactory.createNounPhrase("passageiros");
NPPhraseSpec np2 = this.phraseFactory.createNounPhrase("aeroporto");
np2.setSpecifier("o");
PPPhraseSpec pp = this.phraseFactory.createPrepositionPhrase("a");
pp.addComplement(np2);
SPhraseSpec s = this.phraseFactory.createClause(vp, np, pp);
Assert.assertEquals("Levar passageiros ao aeroporto.", getResult(s));
}