Skip to content

Commit

Permalink
remove needless exception throw
Browse files Browse the repository at this point in the history
  • Loading branch information
jsksxs360 committed Jan 23, 2017
1 parent a1818ef commit 246d0c9
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/me/xiaosheng/word2vec/Word2Vec.java
Original file line number Diff line number Diff line change
Expand Up @@ -196,10 +196,9 @@ private float calMaxSimilarity(String centerWord, List<String> wordList) {
* 所有词语权值设为1
* @param sentence1Words 句子1词语列表
* @param sentence2Words 句子2词语列表
* @return
* @throws Exception 词语列表和权值向量长度不同
* @return 两个句子的相似度
*/
public float sentenceSimilarity(List<String> sentence1Words, List<String> sentence2Words) throws Exception {
public float sentenceSimilarity(List<String> sentence1Words, List<String> sentence2Words) {
if (loadModel == false) {
return -1;
}
Expand Down Expand Up @@ -231,7 +230,7 @@ public float sentenceSimilarity(List<String> sentence1Words, List<String> senten
* @param sentence2Words 句子2词语列表
* @param weightVector1 句子1权值向量
* @param weightVector2 句子2权值向量
* @return
* @return 两个句子的相似度
* @throws Exception 词语列表和权值向量长度不同
*/
public float sentenceSimilarity(List<String> sentence1Words, List<String> sentence2Words, float[] weightVector1, float[] weightVector2) throws Exception {
Expand Down

0 comments on commit 246d0c9

Please sign in to comment.