当前位置 首页 电影 剧情片 《恋之风景》

恋之风景

清晰度:HD高清

2003/香港/法国/

豆瓣评分:6.8分

播放地址

剧情简介

。"; //initstopwords StopWordsHandlersw=newStopWordsHandler(); //getStopWords Liststopwords=sw.getStopWords(); //split String[]contents=paragraph.split(",|。|
|(|)"); Listsegment=newArrayList(); for(Stringcontent:contents){ //⽤空格分隔 Stringcon=content+""; //长度限制 String[]words=con.split("\\s+"); //使用链表存储 LinkedListlist=newLinkedList(Arrays.asList(words)); //list转array String[]arrays=list.toArray(newString[0]); //对数组进⾏预处理 for(inti=0;i2){ continue; } //去除⾮中⽂ if(isContainsEnglish(string)){ arrays[i]=""; } //去除停顿词 if(stopwords.contains(string)){ arrays[i]=""; } } //prefetchtheremain intprefetch=0; //取出为""的 for(inti=0;i=2){ String[]temp=Arrays.copyOfRange(arrays,i-prefetch,i); Stringtp=getArrayString(temp); if(isContainsEnglish(tp)){ continue; } if(stopwords.contains(tp)){ break; } segment.add(tp); //prefetch=0; i=i-prefetch+1; prefetch=0; continue; }else{ prefetch=0; continue; } } } } //输出 for(Stringstring:segment){ System.out.println(string); } } publicstaticbooleanisContainsEnglish(Stringinput){ Stringregex=".*[a-zA-Z]+.*"; Matcherm=Pattern.compile(regex).matcher(input); returnm.matches(); } publicstaticStringgetArrayString(String[]args){ char[]arr={0}; StringBuffersb=newStringBuffer(); for(Stringi:args){ i=i+""; sb.append(i); } Stringstr=sb.toString(); str=str.substring(0,str.length()-1); returnstr; }}

Copyright © 2025