Package org.mediameter.cliff.extractor

Examples of org.mediameter.cliff.extractor.PersonOccurrence


                    } else {
                        if(queuedEntityText!=null && lastEntityType!=null){
                            //TODO: figure out if we need the character index here or not
                            switch(lastEntityType){
                            case "PERSON":
                                entities.addPerson(new PersonOccurrence(queuedEntityText, 0));
                                break;
                            case "LOCATION":
                                entities.addLocation(new SentenceLocationOccurrence(queuedEntityText, storySentencesId));
                                break;
                            case "ORGANIZATION":
View Full Code Here


    }

    @Test
    public void testNonDuplicates() {
        List<PersonOccurrence> occurrences = new ArrayList<PersonOccurrence>();
        occurrences.add( new PersonOccurrence("Obama", 0));
        occurrences.add( new PersonOccurrence("Romney", 100));
        KindaDumbDisambiguationStrategy strategy = new KindaDumbDisambiguationStrategy();
        List<ResolvedPerson> resolvedPeople = strategy.select(occurrences);
        assertEquals("Removed a non-duplicate!", 2, resolvedPeople.size());
    }
View Full Code Here

    }

    @Test
    public void testExactDuplicate() {
        List<PersonOccurrence> occurrences = new ArrayList<PersonOccurrence>();
        occurrences.add( new PersonOccurrence("Obama", 0));
        occurrences.add( new PersonOccurrence("Obama", 100));
        KindaDumbDisambiguationStrategy strategy = new KindaDumbDisambiguationStrategy();
        List<ResolvedPerson> resolvedPeople = strategy.select(occurrences);
        assertEquals("Exact duplicate not removed!", 1, resolvedPeople.size());
    }
View Full Code Here

    }
   
    @Test
    public void testCaseDuplicate() {
        List<PersonOccurrence> occurrences = new ArrayList<PersonOccurrence>();
        occurrences.add( new PersonOccurrence("Obama", 0));
        occurrences.add( new PersonOccurrence("obama", 100));
        KindaDumbDisambiguationStrategy strategy = new KindaDumbDisambiguationStrategy();
        List<ResolvedPerson> resolvedPeople = strategy.select(occurrences);
        assertEquals("Non-matching case duplicate not removed!", 1, resolvedPeople.size());
    }
View Full Code Here

        assertEquals("Non-matching case duplicate not removed!", 1, resolvedPeople.size());
    }
    @Test
    public void testNotFullNameDuplicate() {
        List<PersonOccurrence> occurrences = new ArrayList<PersonOccurrence>();
        occurrences.add( new PersonOccurrence("Obama", 0));
        occurrences.add( new PersonOccurrence("Barack Obama", 100));
        KindaDumbDisambiguationStrategy strategy = new KindaDumbDisambiguationStrategy();
        List<ResolvedPerson> resolvedPeople = strategy.select(occurrences);
        assertEquals("Non-matching names duplicate not removed!", 1, resolvedPeople.size());
    }
View Full Code Here

        assertEquals("Non-matching names duplicate not removed!", 1, resolvedPeople.size());
    }
    @Test
    public void testChooseLongestName() {
        List<PersonOccurrence> occurrences = new ArrayList<PersonOccurrence>();
        occurrences.add( new PersonOccurrence("Obama", 0));
        occurrences.add( new PersonOccurrence("Barack Obama", 100));
        KindaDumbDisambiguationStrategy strategy = new KindaDumbDisambiguationStrategy();
        List<ResolvedPerson> resolvedPeople = strategy.select(occurrences);
        ResolvedPerson person = resolvedPeople.get(0);
        assertEquals("Resolved person not choosing longest name", "Barack Obama", person.getName());
    }
View Full Code Here

TOP

Related Classes of org.mediameter.cliff.extractor.PersonOccurrence

Copyright © 2018 www.massapicom. 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.