<commit_before>
/*
 * Copyright 1999-2002 Carnegie Mellon University.  
 * Portions Copyright 2002 Sun Microsystems, Inc.  
 * Portions Copyright 2002 Mitsubishi Electronic Research Laboratories.
 * All Rights Reserved.  Use is subject to license terms.
 * 
 * See the file "license.terms" for information on usage and
 * redistribution of this file, and for a DISCLAIMER OF ALL 
 * WARRANTIES.
 *
 */

package edu.cmu.sphinx.decoder.linguist;

import edu.cmu.sphinx.util.SphinxProperties;
import edu.cmu.sphinx.util.Timer;
import edu.cmu.sphinx.knowledge.dictionary.Pronunciation;
import edu.cmu.sphinx.knowledge.language.LanguageModel;
import edu.cmu.sphinx.knowledge.language.WordSequence;
import edu.cmu.sphinx.decoder.linguist.Grammar;
import edu.cmu.sphinx.decoder.linguist.GrammarNode;

import java.io.IOException;
import java.util.List;
import java.util.Set;
import java.util.Iterator;
import java.util.ArrayList;


/**
 * Defines a grammar based upon a lanaguage model
 *
 * This is a simple version that generates one grammar node per word.
 * This grammar can deal with unigram and bigram grammars of up to
 * 1000 or so words. 
 *
 * Note that all probabilities are in the log math domain
 */
public class LMGrammar extends Grammar {

    /**
     * Creates the grammar from the language model.  This Grammar
     * contains one word per grammar node. Each word (and grammar
     * node) is connected to all other words with the given<commit_msg>Removed an unnecessary import.<commit_after>
/*
 * Copyright 1999-2002 Carnegie Mellon University.  
 * Portions Copyright 2002 Sun Microsystems, Inc.  
 * Portions Copyright 2002 Mitsubishi Electronic Research Laboratories.
 * All Rights Reserved.  Use is subject to license terms.
 * 
 * See the file "license.terms" for information on usage and
 * redistribution of this file, and for a DISCLAIMER OF ALL 
 * WARRANTIES.
 *
 */

package edu.cmu.sphinx.decoder.linguist;

import edu.cmu.sphinx.util.SphinxProperties;
import edu.cmu.sphinx.util.Timer;
import edu.cmu.sphinx.knowledge.language.LanguageModel;
import edu.cmu.sphinx.knowledge.language.WordSequence;
import edu.cmu.sphinx.decoder.linguist.Grammar;
import edu.cmu.sphinx.decoder.linguist.GrammarNode;

import java.io.IOException;
import java.util.List;
import java.util.Set;
import java.util.Iterator;
import java.util.ArrayList;


/**
 * Defines a grammar based upon a lanaguage model
 *
 * This is a simple version that generates one grammar node per word.
 * This grammar can deal with unigram and bigram grammars of up to
 * 1000 or so words. 
 *
 * Note that all probabilities are in the log math domain
 */
public class LMGrammar extends Grammar {

    /**
     * Creates the grammar from the language model.  This Grammar
     * contains one word per grammar node. Each word (and grammar
     * node) is connected to all other words with the given
{'fraction_non_alphanumeric': 0.0768695652173913, 'fraction_numerical': 0.01391304347826087, 'mean_word_length': 3.907849829351536, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1879192', 'n_tokens_mistral': 954, 'n_tokens_neox': 852, 'n_words': 308}