Permalink
Browse files

* bugfix: one should not put % with ?

* added statistics dictionary

git-svn-id: https://dev.upnl.org/svn/ircbot2/trunk@84 66f668a4-574d-4515-85ec-6e73d9c367eb
  • Loading branch information...
1 parent 72b068c commit 375cbe092f83b846839368860437ffbe403d1d6a klutzy committed Apr 24, 2010
Showing with 4 additions and 4 deletions.
  1. BIN lib/mathnet.db
  2. +4 −4 plugins/mathnet.py
View
Binary file not shown.
View
@@ -6,12 +6,12 @@
def search(eng):
"""mathnet에서 영어 to 한국어 용어를 검색."""
global con
- pq = "select english, korean from mathnet where %s order by length(english) asc limit 3"
- q = pq % ("english = '?'")
+ pq = "select distinct english, korean from mathnet where %s order by length(english) asc limit 3"
+ q = pq % ("english = ?")
f = con.execute(q, (eng,)).fetchall()
if not f:
- q = pq % ("english like '%?%'")
- f = con.execute(q, (eng,)).fetchall()
+ q = pq % ("english like ?")
+ f = con.execute(q, ('%'+eng+'%',)).fetchall()
return f
def on_pubmsg(bot, connection, event):

0 comments on commit 375cbe0

Please sign in to comment.