Examples of TimeFrame


Examples of edu.cmu.sphinx.util.TimeFrame

        Queue<List<String>> texts = new ArrayDeque<List<String>>();
        Queue<TimeFrame> timeFrames = new ArrayDeque<TimeFrame>();

        ranges.offer(new Range(0, transcript.size()));
        texts.offer(transcript);
        TimeFrame totalTimeFrame = TimeFrame.INFINITE;
        timeFrames.offer(totalTimeFrame);
        long lastFrame = TimeFrame.INFINITE.getEnd();

        for (int i = 0; i < 4; ++i) {
            if (i == 3) {
                context.setLocalProperty("decoder->searchManager",
                        "alignerSearchManager");
                context.processBatch();
            }

            while (!texts.isEmpty()) {
                assert texts.size() == ranges.size();
                assert texts.size() == timeFrames.size();

                List<String> text = texts.poll();
                TimeFrame frame = timeFrames.poll();
                Range range = ranges.poll();

                logger.info("Aligning frame " + frame + " to text " + text
                        + " range " + range);
View Full Code Here

Examples of edu.cmu.sphinx.util.TimeFrame

                    + transcript.subList(start, end).toString());
            return;
        }

        texts.offer(transcript.subList(start, end));
        timeFrames.offer(new TimeFrame(timeStart, timeEnd));
        ranges.offer(new Range(start, end - 1));
    }
View Full Code Here

Examples of edu.cmu.sphinx.util.TimeFrame

     * @param node the node to extract information from
     * @param confidence the confidence (posterior) to assign
     */
    public WordResult(Node node, double confidence) {
        this(node.getWord(),
             new TimeFrame(node.getBeginTime(), node.getEndTime()),
             LogMath.LOG_ZERO, confidence);
    }
View Full Code Here

Examples of edu.cmu.sphinx.util.TimeFrame

        for (List<WordResult> utt : utts) {
            long startFrame = Long.MAX_VALUE;
            long endFrame = Long.MIN_VALUE;

            for (WordResult result : utt) {
                TimeFrame frame = result.getTimeFrame();
                startFrame = Math.min(startFrame, frame.getStart());
                endFrame = Math.max(endFrame, frame.getEnd());
                System.out.print(result.getPronunciation().getWord());
                System.out.print(' ');
            }

            String[] basename = inFile.getName().split("\\.wav$");
View Full Code Here

Examples of edu.cmu.sphinx.util.TimeFrame

            while (token != null) {
                if (token.isWord()) {
                    Word word = token.getWord();
                    if (withFillers || !word.isFiller()) {
                        TimeFrame timeFrame =
                                new TimeFrame(
                                        ((FloatData) prevFeature)
                                                .getCollectTime(),
                                        ((FloatData) prevWordFirstFeature)
                                                .getCollectTime());
                        result.add(new WordResult(word, timeFrame, token
View Full Code Here

Examples of edu.cmu.sphinx.util.TimeFrame

        while (token != null) {
            if (token.isWord()) {
                if (word != null && lastFeature != null) {
                    if (withFillers || !word.isFiller()) {
                        TimeFrame timeFrame = new TimeFrame(((FloatData) lastFeature).getCollectTime(),
                                ((FloatData) lastWordFirstFeature).getCollectTime());
                        result.add(new WordResult(word, timeFrame, token.getScore(), 1.));
                    }
                    word = token.getWord();
                    lastWordFirstFeature = lastFeature;
View Full Code Here

Examples of edu.cmu.sphinx.util.TimeFrame

                .setLanguageModelPath("resource:/edu/cmu/sphinx/models/language/en-us.lm.dmp");

        StreamSpeechRecognizer recognizer = new StreamSpeechRecognizer(
                configuration);

        TimeFrame t;
        SpeechResult result;

        for (SpeakerCluster spk : speakers) {
            Stats stats = recognizer.createStats(1);
            ArrayList<Segment> segments = spk.getSpeakerIntervals();

            for (Segment s : segments) {
                long startTime = s.getStartTime();
                long endTime = s.getStartTime() + s.getLength();
                t = new TimeFrame(startTime, endTime);

                recognizer.startRecognition(url.openStream(), t);
                while ((result = recognizer.getResult()) != null) {
                    stats.collect(result);
                }
                recognizer.stopRecognition();
            }

            Transform profile;
            // Create the Transformation
            profile = stats.createTransform();
            recognizer.setTransform(profile);

            for (Segment seg : segments) {
                long startTime = seg.getStartTime();
                long endTime = seg.getStartTime() + seg.getLength();
                t = new TimeFrame(startTime, endTime);

                // Decode again with updated SpeakerProfile
                recognizer.startRecognition(url.openStream(), t);
                while ((result = recognizer.getResult()) != null) {
                    System.out.format("Hypothesis: %s\n",
View Full Code Here

Examples of net.sourceforge.ganttproject.time.TimeFrame

            int offsetEnd = 0;
            Date currentDate = myStartDate;
            do {
                final TimeUnit bottomUnit = getBottomUnit();
                final TimeUnit defaultUnit = myTimeUnitStack.getDefaultTimeUnit();
                TimeFrame currentFrame = myTimeUnitStack.createTimeFrame(
                        currentDate, bottomUnit, defaultUnit);
                Date endDate = currentFrame.getFinishDate();
                offsetEnd += getBottomUnitWidth();
                bottomUnitOffsets.add(
                        new Offset(
                                bottomUnit,
                                myStartDate,
                                endDate,
                                offsetEnd,
                                null));
                currentDate = endDate;
            } while (offsetEnd <= getChartWidth());
        }
        {
            int offsetEnd = 0;
            Date currentDate = myStartDate;
            SkewedFramesWidthFunction widthFunction = new SkewedFramesWidthFunction();
            widthFunction.initialize();
            do {
                final TimeUnit topUnit = getTopUnit(currentDate);
                final TimeUnit defaultUnit = myTimeUnitStack.getDefaultTimeUnit();
                final TimeFrame currentFrame = myTimeUnitStack.createTimeFrame(
                        currentDate, topUnit, defaultUnit);

                Date endDate = currentFrame.getFinishDate();
                offsetEnd += widthFunction.getTimeFrameWidth(currentFrame);
                topUnitOffsets.add(
                        new Offset(
                                topUnit,
                                myStartDate,
View Full Code Here

Examples of net.sourceforge.ganttproject.time.TimeFrame

        myStartDate = startDate;
        fireStartDateChanged(e);
    }

    private TimeFrame scrollTimeFrame(Date scrolledDate) {
        TimeFrame result = null;
        if (getTopTimeUnit().isConstructedFrom(getBottomTimeUnit())) {
            result = myTimeUnitStack.createTimeFrame(scrolledDate,
                    getTopTimeUnit(), getBottomTimeUnit());
        } else {
            result = myTimeUnitStack.createTimeFrame(scrolledDate,
View Full Code Here

Examples of net.sourceforge.ganttproject.time.TimeFrame

            result = new Offset[] {new Offset(offsetUnit, bottomUnitStartDate, bottomUnitStartDate, 0, null)};
        }
        else if (frameBottomUnit.isConstructedFrom(offsetUnit)) {
            //java.util.List buf = new ArrayList();
            int outerFrameUnitCount = timeFrame.getUnitCount(offsetUnit);
            TimeFrame innerFrame = myStack.createTimeFrame(bottomUnitStartDate,
                    frameBottomUnit, offsetUnit);
            int offsetUnitCount = innerFrame.getUnitCount(offsetUnit);
            result = new Offset[offsetUnitCount];
            for (int i=0; i<offsetUnitCount; i++) {
                Date offsetEnd = innerFrame.getUnitFinish(offsetUnit, i);
                int offsetPixels = (i+1)*frameBottomUnitWidth/outerFrameUnitCount;
                result[i] = new Offset(offsetUnit, bottomUnitStartDate, offsetEnd, offsetPixels, null);
            }
        } else {
            throw new RuntimeException("We should not be here");
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.