⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 batchfile.java

📁 It is the Speech recognition software. It is platform independent. To execute the source code,
💻 JAVA
字号:
/* * Copyright 1999-2002 Carnegie Mellon University.   * Portions Copyright 2002 Sun Microsystems, Inc.   * Portions Copyright 2002 Mitsubishi Electric 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.util;import java.io.BufferedReader;import java.io.FileReader;import java.io.IOException;import java.util.ArrayList;import java.util.List;/** * Provides a set of utilities methods for manipulating batch files. */public class BatchFile {    /**     * Returns a List of the lines in a batch file.     *     * @param batchFile the batch file to read     *     * @return a List of the lines in a batch file     */    public static List getLines(String batchFile) throws IOException {        return getLines(batchFile, 0);    }    /**     * Returns a List of the lines in a batch file.     *     * @param batchFile the batch file to read     * @param skip the number of lines to skip between items     *     * @return a List of the lines in a batch file     */    public static List getLines(String batchFile, int skip) throws IOException {        int curCount = skip;	List list = new ArrayList();	BufferedReader reader = new BufferedReader(new FileReader(batchFile));	String line = null;	while ((line = reader.readLine()) != null) {            if (line.length() > 0) {                if (++curCount >= skip) {                    list.add(line);                    curCount = 0;                }            }	}	reader.close();        return list;    }    /**     * Returns the file name portion of a line in a batch file.     * This is the portion of the line before the first space.     *     * @return the file name portion of a line in a batch file.     */    public static String getFilename(String batchFileLine) {        int firstSpace = batchFileLine.indexOf(" ");        return batchFileLine.substring(0, firstSpace).trim();    }    /**     * Returns the reference string portion of a line in a batch file.     * This is the portion of the line after the first space     *     * @return the reference string portion of a line in a batch file.     */    public static String getReference(String batchFileLine) {        int firstSpace = batchFileLine.indexOf(" ");        return batchFileLine.substring(firstSpace+1).trim();    }}  

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -