当前位置:编程学习 > JAVA >>

悬赏寻找改程序达人

--------------------编程问答-------------------- 比较意思的相同单词,得到最多的一组


这个意思相同是怎么个相同法
是表示意思的字符串完全相同,还是语意相同? --------------------编程问答-------------------- lesson
1. (6) lesson -- (a unit of instruction; "he took driving lessons")
2. (4) example, deterrent example, lesson, object lesson -- (punishment intended as a warning to others; "they decided to make an example of him")
3. (4) moral, lesson -- (the significance of a story or event; "the moral of the story is to love thy neighbor")
4. (3) lesson -- (a task assigned for individual study; "he did the lesson for today")



learnt
1. (91) learn, larn, acquire -- (gain knowledge or skills; "She learned dancing from her sister"; "I learned Sanskrit"; "Children acquire language at an amazing rate")
2. (53) learn, hear, get word, get wind, pick up, find out, get a line, discover, see -- (get to know or become aware of, usually accidentally; "I learned that she has two grown-up children"; "I see that you have been promoted")
3. (6) memorize, memorise, con, learn -- (commit to memory; learn by heart; "Have you memorized your lines for the play yet?")
4. (4) learn, study, read, take -- (be a student of a certain subject; "She is reading for the bar exam")
5. (2) teach, learn, instruct -- (impart skills or knowledge to; "I taught them French"; "He instructed me in building a boat")
6. determine, check, find out, see, ascertain, watch, learn -- (find out, learn, or determine with certainty, usually by making an inquiry or other effort; "I want to see whether she speaks French"; "See whether it works"; "find out if he speaks Russian"; "Check whether the train leaves on time") --------------------编程问答-------------------- 字符串相同,语意相同计算机无法实现。这里只考虑字符串。
如:
eat 有2个意思
1. verb ex. eat apples
2. verb ex. My card is eaten.
apple有2个意思
1. a fruit. ex: apple trees
2. a company. ex: apple computers
这里就会选eat的第一个意思和apple的第一个意思
因为他们的相同值是1,其它三组为0 --------------------编程问答-------------------- 更正,apple的第二个意思也是1.所以这里可以返回1,1,或返回1,2 --------------------编程问答-------------------- 也就是说重点是给两组字符串然后一组取一个,找出相同单词数最多的两个字符串组合

这个应该不难,只是字符串太多太长的时候要考虑下效率的问题 --------------------编程问答-------------------- 能告诉我一下在wordcommand文件里怎么改吗? --------------------编程问答-------------------- 说白了,就是双层for循环找相同值的问题
String[] s1;
String[] s2;
for(String ss:s1){
for(String sss:s2){
if(sss.contains(ss)){
//进行处理
}
}
}
这里s1和s2都为单词组,如果是一段语句的话,就是四层for循环,把s1和s2断句
补充:Java ,  Java SE
CopyRight © 2012 站长网 编程知识问答 www.zzzyk.com All Rights Reserved
部份技术文章来自网络,