Examples of removeNaturalText()


Examples of org.apache.stanbol.entityhub.servicesapi.model.Representation.removeNaturalText()

        // there is also the possibility to explicitly parse null as language
        // could internally case differences however externally this is the same
        rep.addNaturalText(field, strTextNoLang, (String) null);
        assertTrue(asCollection(rep.getFieldNames()).contains(field));
        rep.removeNaturalText(field, strTextNoLang, (String) null);
        assertFalse(asCollection(rep.getFieldNames()).contains(field));

        Text text = vf.createText("Das ist ein Text zum testen des Text Objektes", "de");
        rep.add(field, text);
        assertTrue(asCollection(rep.getFieldNames()).contains(field));
View Full Code Here

Examples of org.apache.stanbol.entityhub.servicesapi.model.Representation.removeNaturalText()

    }

    @Test(expected = IllegalArgumentException.class)
    public void testNullFieldRemoveNaturalText() {
        Representation rep = createRepresentation(null);
        rep.removeNaturalText(null, "test");
    }

    @Test(expected = IllegalArgumentException.class)
    public void testNullFieldRemoveReference() {
        Representation rep = createRepresentation(null);
View Full Code Here

Examples of org.apache.stanbol.entityhub.servicesapi.model.Representation.removeNaturalText()

    }

    @Test(expected = IllegalArgumentException.class)
    public void testEmptyFieldRemoveNaturalText() {
        Representation rep = createRepresentation(null);
        rep.removeNaturalText("", "test");
    }

    @Test(expected = IllegalArgumentException.class)
    public void testEmptyFieldRemoveReference() {
        Representation rep = createRepresentation(null);
View Full Code Here

Examples of org.apache.stanbol.entityhub.servicesapi.model.Representation.removeNaturalText()

        // test removal for texts (with and without language)
        String strText = "test text";
        String strTextLang = "en";
        rep.addNaturalText(field, strText, strTextLang);
        assertTrue(asCollection(rep.getFieldNames()).contains(field));
        rep.removeNaturalText(field, strText, strTextLang);
        assertFalse(asCollection(rep.getFieldNames()).contains(field));

        String strTextNoLang = "test text without lang";
        rep.addNaturalText(field, strTextNoLang);
        assertTrue(asCollection(rep.getFieldNames()).contains(field));
View Full Code Here

Examples of org.apache.stanbol.entityhub.servicesapi.model.Representation.removeNaturalText()

        assertFalse(asCollection(rep.getFieldNames()).contains(field));

        String strTextNoLang = "test text without lang";
        rep.addNaturalText(field, strTextNoLang);
        assertTrue(asCollection(rep.getFieldNames()).contains(field));
        rep.removeNaturalText(field, strTextNoLang);
        assertFalse(asCollection(rep.getFieldNames()).contains(field));

        // there is also the possibility to explicitly parse null as language
        // could internally case differences however externally this is the same
        rep.addNaturalText(field, strTextNoLang, (String) null);
View Full Code Here

Examples of org.apache.stanbol.entityhub.servicesapi.model.Representation.removeNaturalText()

        // there is also the possibility to explicitly parse null as language
        // could internally case differences however externally this is the same
        rep.addNaturalText(field, strTextNoLang, (String) null);
        assertTrue(asCollection(rep.getFieldNames()).contains(field));
        rep.removeNaturalText(field, strTextNoLang, (String) null);
        assertFalse(asCollection(rep.getFieldNames()).contains(field));

        Text text = vf.createText("Das ist ein Text zum testen des Text Objektes", "de");
        rep.add(field, text);
        assertTrue(asCollection(rep.getFieldNames()).contains(field));
View Full Code Here

Examples of org.apache.stanbol.entityhub.servicesapi.model.Representation.removeNaturalText()

    }

    @Test(expected = IllegalArgumentException.class)
    public void testNullFieldRemoveNaturalText() {
        Representation rep = createRepresentation(null);
        rep.removeNaturalText(null, "test");
    }

    @Test(expected = IllegalArgumentException.class)
    public void testNullFieldRemoveReference() {
        Representation rep = createRepresentation(null);
View Full Code Here

Examples of org.apache.stanbol.entityhub.servicesapi.model.Representation.removeNaturalText()

    public void testRemoveNaturalTextWithWrongLanguage() {
        String field = "urn:the.field:used.for.this.Test";
        Representation rep = initNaturalLanguageTest(field);
        // Test removal of natural language
        // remove a specific test, but wrong language -> no effect
        rep.removeNaturalText(field, NL_TEST_en2, "de");
        assertTrue(asCollection(rep.get(field)).size() == NL_TEST_all.size());
    }

    @Test
    public void testRemoveNaturalTextWithWrongNullLanguage() {
View Full Code Here

Examples of org.apache.stanbol.entityhub.servicesapi.model.Representation.removeNaturalText()

    @Test
    public void testRemoveNaturalTextWithWrongNullLanguage() {
        String field = "urn:the.field:used.for.this.Test";
        Representation rep = initNaturalLanguageTest(field);
        // remove a specific text, but with wrong null language -> also no effect
        rep.removeNaturalText(field, NL_TEST_de, (String) null);
        assertTrue(asCollection(rep.get(field)).size() == NL_TEST_all.size());
    }

    @Test
    public void testRemoveNaturalTextWithCorrectAndWrongLanguage() {
View Full Code Here

Examples of org.apache.stanbol.entityhub.servicesapi.model.Representation.removeNaturalText()

    @Test
    public void testRemoveNaturalTextWithCorrectAndWrongLanguage() {
        String field = "urn:the.field:used.for.this.Test";
        Representation rep = initNaturalLanguageTest(field);
        // remove a specific text, parse one correct and one wrong lang
        rep.removeNaturalText(field, NL_TEST_en2, "de", "en");
        Set<String> textSet = new HashSet<String>(NL_TEST_all);
        // remove all remaining values
        for (Iterator<Text> texts = rep.getText(field); texts.hasNext(); textSet.remove(texts.next()
                .getText()))
            ;
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.