Value.java
资源名称:Parsing.rar [点击查看]
上传用户:xiaozhuqw
上传日期:2021-11-10
资源大小:21k
文件大小:1k
源码类别:
词法分析
开发平台:
Java
- public class Value {
- public String ls; //规则的左部
- public double prob; //规则的概率
- public Value(){}
- public Value(String line){
- String[] s;
- //this.rs = new Vector();
- s = line.split(" ");
- this.ls = s[1];
- this.prob = Double.parseDouble(s[0]);
- //Value value = new Value(s[1], Double.parseDouble(s[0]));
- }
- public Value(String ls, double prob){
- this.ls = ls;
- this.prob = prob;
- }
- public void setLs(String ls){
- this.ls = ls;
- }
- public void setProb(double prob){
- this.prob = prob;
- }
- public String getLs(){
- return this.ls;
- }
- public double getProb(){
- return this.prob;
- }
- }