Test.java
资源名称:Parsing.rar [点击查看]
上传用户:xiaozhuqw
上传日期:2021-11-10
资源大小:21k
文件大小:0k
源码类别:
词法分析
开发平台:
Java
- public class Test {
- public static void main(String[] args){
- String s = new String("S ( vp ( vp ( v(穿) ) + np ( ap ( a(好) ) + np ( n(衣服) ) ) ) )nnS ( vp ( vp ( v(穿) )");
- //int i = s.indexOf("S");
- //s = s.substring(i);
- //System.out.println(s);
- String[] ss = s.split("nn");
- System.out.println(ss);
- /*String[] s1 = s.split(" ");
- for(int i = 0;i<s1.length;i++)
- System.out.println(s1[i]);*/
- }
- }