java实现中英⽂翻译_java实现简单的英⽂⽂本单词翻译器功能水瓶座是几月几日出生
⽰例
本⽂实例讲述了java实现简单的英⽂⽂本单词翻译器功能。分享给⼤家供⼤家参考,具体如下:
直接上代码:
package fanyi;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.UnsupportedEncodingException;
import java.util.Scanner;
import java.util.StringTokenizer;
public class text {
public static void handle(String eString) throws IOException {
StringTokenizer st = new StringTokenizer(eString,",!' '.;");玉米卷发型
while(st.hasMoreElements()) {
String sText;
sText = st.nextElement().toString();
//System.out.println(sText);
String encoding="GBK";
怎么取消订阅
String filepath="fanyi\\src\\fanyi\\";
File file=new File("G:\\workspace4\\fanyi\\src\\fanyi\\");
// System.out.println("2222");
if(file.isFile() && ists()){ //判断⽂件是否存在
//System.out.println("1111");
InputStreamReader read = new InputStreamReader(new FileInputStream(file),encoding);//考虑到编码格式
BufferedReader bufferedReader = new BufferedReader(read);
String lineTxt = null;
while((lineTxt = adLine()) != null){
//System.out.println(lineTxt);
//System.out.println("333");
String().equals(sText)){
System.out.println(sText + adLine());出纳的工作
跳绳瘦腿效果好吗}
}
read.clo();
}
}成语四字
}
public static void main(String[] args) throws IOException { Scanner sc = new Scanner(System.in);
System.out.println("请输⼊英⽂⽂本:");
String eText = sc.nextLine();
handle(eText);
大年初二//System.out.println(eText);
}
}
⽂件结构如下:
运⾏结果:
你人真好
希望本⽂所述对⼤家java程序设计有所帮助。