Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
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...
commit 375cbe092f83b846839368860437ffbe403d1d6a 1 parent 72b068c
klutzy authored
Showing with 4 additions and 4 deletions.
  1. BIN  lib/mathnet.db
  2. +4 −4 plugins/mathnet.py
BIN  lib/mathnet.db
View
Binary file not shown
8 plugins/mathnet.py
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):
Please sign in to comment.
Something went wrong with that request. Please try again.