Topic: 帮我看看,哪里错了,头晕脑涨了(关于字符匹配度) |
Print this page |
1.帮我看看,哪里错了,头晕脑涨了(关于字符匹配度) | Copy to clipboard |
Posted by: pn526 Posted on: 2005-07-26 17:21 请使用准确的文字描述作为标题 Your next post without a proper Subject will be removed. Original subject : 帮我看看,哪里错了,头晕脑涨了 我写个程序关于字符匹配度的.弄不出来.是参考一个pascal的程序来的. 关键词:字符串匹配度 'John' and 'John' = 100% 'John' and 'Jon' = 75% 'Jim' and 'James' = 40% "Luke Skywalker" and 'Darth Vader' = 0%
我自己用java写的如下.
帮我看看,弄不出来!3q |
2.Re:帮我看看,哪里错了,头晕脑涨了(关于字符匹配度) [Re: pn526] | Copy to clipboard |
Posted by: why Posted on: 2005-07-26 19:52 I don't know why you would put your implementation directly in a jsp, which would be hard to debug. |
3.Re:帮我看看,哪里错了,头晕脑涨了(关于字符匹配度) [Re: why] | Copy to clipboard |
Posted by: pn526 Posted on: 2005-07-26 19:55 why wrote: 我的输入页面已经写好了,就直接把s付值了.这样检测的时候就不用执行第一页面了.这个应该说不是很大的问题把. |
4.Re:帮我看看,哪里错了,头晕脑涨了(关于字符匹配度) [Re: pn526] | Copy to clipboard |
Posted by: pn526 Posted on: 2005-07-26 19:56 问题出在了76行 |
5.Re:帮我看看,哪里错了,头晕脑涨了(关于字符匹配度) [Re: pn526] | Copy to clipboard |
Posted by: why Posted on: 2005-07-26 20:35 pn526 wrote: If I were you, I would pull the function out and debug -- most probably prepare a unit test suite for it. 问题出在了76行 p1=1;p2=1; Java is zero-based. |
6.Re:帮我看看,哪里错了,头晕脑涨了(关于字符匹配度) [Re: why] | Copy to clipboard |
Posted by: pn526 Posted on: 2005-07-26 20:41 why wrote: 我改成p1=0;p2=0;也会报同样的错.我就改来改去.两天了没有搞明白错在哪里? 不过还是很感谢你啊! |
7.Re:帮我看看,哪里错了,头晕脑涨了(关于字符匹配度) [Re: pn526] | Copy to clipboard |
Posted by: pn526 Posted on: 2005-07-27 10:01 java.lang.ArrayIndexOutOfBoundsException: 4 76行提示这个错误.过不去! |
8.Re:帮我看看,哪里错了,头晕脑涨了(关于字符匹配度) [Re: pn526] | Copy to clipboard |
Posted by: why Posted on: 2005-07-27 11:48 pn526 wrote: That's why I would pull the function out and debug -- don't you know how to use a debugger? You have only corrected p1=1;p2=1; Don't you think that all the conditional statements that involve p1 & p2 might have to be changed as well? |
9.Re:帮我看看,哪里错了,头晕脑涨了(关于字符匹配度) [Re: pn526] | Copy to clipboard |
Posted by: pn526 Posted on: 2005-07-27 17:07 谢谢.我再想想.我反映有点慢! 谢谢why大哥! |
10.Re:帮我看看,哪里错了,头晕脑涨了(关于字符匹配度) [Re: pn526] | Copy to clipboard |
Posted by: ranchgirl Posted on: 2005-07-28 07:24 pn526 wrote: What kind of stupid definition of "字符串匹配度"? "Luke Skywalker" and 'Darth Vader' = 0% ?????????????????????? I did not waste my time to read the code, since it does not worth to read, let alone embed code in JSP!!! I don't know why Mr. WHY bothered to read / help on this kind of stuff? ================================================== To pn526: Throw the code into GC, do something meaningful or useful! However, if you have no choice and really need to do this, ie. it is a HW assignment or so, then listen to Mr. WHY, put your code into a standalone program, compile it, run it, test it, make it do the "right" stupid things as specified. Then you can cut and paste into your JSP, and test it again! Happy learning and good luck! |
11.Re:帮我看看,哪里错了,头晕脑涨了(关于字符匹配度) [Re: gongshi] | Copy to clipboard |
Posted by: why Posted on: 2005-07-28 10:15 gongshi wrote: Frankly I didn't read what the 字符串匹配度 is, and I haven't read the code except line 76 and the few lines around it. In fact I would try to answer or redirect all the topics posted on this board if the posters don't request 緊急幫忙 or 詳細解釋. As an administrator, I don't think I could use words like stupid, garbage, etc. |
12.Re:帮我看看,哪里错了,头晕脑涨了(关于字符匹配度) [Re: pn526] | Copy to clipboard |
Posted by: pn526 Posted on: 2005-07-28 10:26 谢谢二位.不论怎样.十分感谢. gongshi和why大哥! |
13.Re:帮我看看,哪里错了,头晕脑涨了(关于字符匹配度) [Re: pn526] | Copy to clipboard |
Posted by: lvmingtao Posted on: 2005-07-28 15:52 好贴子 ~~~斑竹请留下~~~~巫山 |
Powered by Jute Powerful Forum® Version Jute 1.5.6 Ent Copyright © 2002-2021 Cjsdn Team. All Righits Reserved. 闽ICP备05005120号-1 客服电话 18559299278 客服信箱 714923@qq.com 客服QQ 714923 |