a686d380 commited on
Commit
386dc73
1 Parent(s): 2a64f12

Create score.py

Browse files
Files changed (1) hide show
  1. score.py +6 -0
score.py ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
 
1
+ def hscore(text):
2
+ cnt = 0
3
+ for i in range(len(text)):
4
+ if text[i:i+1] in keywords or text[i:i+2] in keywords:
5
+ cnt+=1
6
+ return cnt/len(text)