Package org.zanata.dao

Examples of org.zanata.dao.TextFlowDAO


        VersionLocaleKey key =
                new VersionLocaleKey(event.getProjectIterationId(),
                        event.getLocaleId());
        WordStatistic stats = versionStatisticCache.get(key);
        if (stats != null) {
            TextFlowDAO textFlowDAO = serviceLocator.getInstance(TextFlowDAO.class);
            HTextFlow textFlow = textFlowDAO.findById(event.getTextFlowId());

            stats.decrement(event.getPreviousState(),
                    textFlow.getWordCount().intValue());
            stats.increment(event.getNewState(),
                    textFlow.getWordCount().intValue());
View Full Code Here


        when(credentials.getUsername()).thenReturn("mock user");

        projectIterationDAO = new ProjectIterationDAO(getSession());
        documentDAO = new DocumentDAO(getSession());
        textFlowTargetDAO = new TextFlowTargetDAO(getSession());
        textFlowDAO = new TextFlowDAO(getSession());
        rawDocumentDAO = new RawDocumentDAO((getSession()));

        service = seam.reset()
                .use("projectIterationDAO",
                        projectIterationDAO)
View Full Code Here

        checkSourceContainQuery(results, query2);
    }

    @Test
    public void searchBestMatchTMTest() {
        TextFlowDAO textFlowDAO = seam.autowire(TextFlowDAO.class);

        // content0="Yet Another File removed" content1="%d files removed"
        // best matches has 83.33% similarity
        HTextFlow textFlow = textFlowDAO.findById(105L, false);
        assert textFlow != null;

        executeFindBestTMMatch(textFlow, 70, true);
        executeFindBestTMMatch(textFlow, 80, true);
        executeFindBestTMMatch(textFlow, 90, false);
View Full Code Here

        executeFindBestTMMatch(textFlow, 90, false);
    }

    @Test
    public void searchBestMatchTMTest2() {
        TextFlowDAO textFlowDAO = seam.autowire(TextFlowDAO.class);

        // content0="One file removed" content1="%d files removed"
        // best matches has 100% similarity
        HTextFlow textFlow = textFlowDAO.findById(101L, false);
        assert textFlow != null;

        executeFindBestTMMatch(textFlow, 80, true);
        executeFindBestTMMatch(textFlow, 90, true);
        executeFindBestTMMatch(textFlow, 100, true);
View Full Code Here

                                new ProjectIterationDAO(getSession()))
                        .use("entityManager",
                                new FullTextEntityManagerImpl(getEm()))
                        .use("session", new FullTextSessionImpl(getSession()))
                        .use("identity", identity)
                        .use("textFlowDAO", new TextFlowDAO(getSession()))
                        .use("transUnitTransformer", transUnitTransformer)
                        .use("webtrans.gwt.GetTransUnitsNavigationHandler",
                                getTransUnitsNavigationService)
                        .useImpl(TranslationStateCacheImpl.class)
                        .useImpl(TextFlowSearchServiceImpl.class)
View Full Code Here

TOP

Related Classes of org.zanata.dao.TextFlowDAO

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.