{"id":2409,"date":"2015-07-26T10:16:34","date_gmt":"2015-07-26T02:16:34","guid":{"rendered":"http:\/\/ixyzero.com\/blog\/?p=2409"},"modified":"2015-07-26T10:16:34","modified_gmt":"2015-07-26T02:16:34","slug":"translate%e7%94%a810%e8%a1%8cpython%e5%86%99%e6%88%90%e7%9a%84%e6%a8%a1%e7%b3%8a%e6%9f%a5%e8%af%a2","status":"publish","type":"post","link":"https:\/\/ixyzero.com\/blog\/archives\/2409.html","title":{"rendered":"[translate]\u752810\u884cPython\u5199\u6210\u7684\u6a21\u7cca\u67e5\u8be2"},"content":{"rendered":"<h6>\u5bfc\u8bed\uff1a<\/h6>\n<p>\u6a21\u7cca\u5339\u914d\u53ef\u4ee5\u7b97\u662f\u73b0\u4ee3\u7f16\u8f91\u5668(\u5728\u9009\u62e9\u6253\u5f00\u6587\u4ef6\u65f6)\u7684\u4e00\u4e2a\u5fc5\u5907\u7279\u6027\u4e86\uff0c\u5b83\u6240\u505a\u7684\u5c31\u662f\u6839\u636e\u7528\u6237\u8f93\u5165\u7684\u90e8\u5206\u5185\u5bb9\u731c\u6d4b\u7528\u6237\u60f3\u8981\u7684\u6587\u4ef6\u540d\uff0c\u5e76\u63d0\u4f9b\u4e00\u4e2a\u63a8\u8350\u5217\u8868\u4f9b\u7528\u6237\u9009\u62e9\u3002<\/p>\n<h6>\u6837\u4f8b\u5982\u4e0b\uff1a<\/h6>\n<p>Vim (Ctrl-P)<\/p>\n<p><a href=\"http:\/\/ixyzero.com\/blog\/wp-content\/uploads\/2015\/07\/medium_vim-ctrl-p.gif\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-2410\" src=\"http:\/\/ixyzero.com\/blog\/wp-content\/uploads\/2015\/07\/medium_vim-ctrl-p.gif\" alt=\"medium_vim-ctrl-p\" width=\"648\" height=\"478\" \/><\/a><\/p>\n<p>Sublime Text (Cmd-P)<\/p>\n<p><a href=\"http:\/\/ixyzero.com\/blog\/wp-content\/uploads\/2015\/07\/medium_subl-cmd-p.gif\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-2411\" src=\"http:\/\/ixyzero.com\/blog\/wp-content\/uploads\/2015\/07\/medium_subl-cmd-p.gif\" alt=\"medium_subl-cmd-p\" width=\"669\" height=\"460\" \/><\/a><\/p>\n<p>&#8216;\u6a21\u7cca\u5339\u914d&#8217;\u8fd9\u662f\u4e00\u4e2a\u6781\u4e3a\u6709\u7528\u7684\u7279\u6027\uff0c\u540c\u65f6\u4e5f\u975e\u5e38\u6613\u4e8e\u5b9e\u73b0\u3002<\/p>\n<h6>\u95ee\u9898\u5206\u6790\uff1a<\/h6>\n<p>\u6211\u4eec\u6709\u4e00\u5806\u5b57\u7b26\u4e32(\u6587\u4ef6\u540d)\u96c6\u5408\uff0c\u6211\u4eec\u6839\u636e\u7528\u6237\u7684\u8f93\u5165\u4e0d\u65ad\u8fdb\u884c\u8fc7\u6ee4\uff0c\u7528\u6237\u7684\u8f93\u5165\u53ef\u80fd\u662f\u5b57\u7b26\u4e32\u7684\u4e00\u90e8\u5206\u3002\u6211\u4eec\u5c31\u4ee5\u4e0b\u9762\u7684\u96c6\u5408\u4e3a\u4f8b\uff1a<\/p>\n<pre class=\"lang:default decode:true\">&gt;&gt;&gt; collection = ['django_migrations.py',\n                'django_admin_log.py',\n                'main_generator.py',\n                'migrations.py',\n                'api_user.doc',\n                'user_group.doc',\n                'accounts.txt',\n                ]<\/pre>\n<p>\u5f53\u7528\u6237\u8f93\u5165&#8217;djm&#8217;\u5b57\u7b26\u4e32\u65f6\uff0c\u6211\u4eec\u5047\u5b9a\u662f\u5339\u914d\u5230&#8217;<span style=\"color: #0000ff;\"><strong>dj<\/strong><\/span>ango_<span style=\"color: #0000ff;\"><strong>m<\/strong><\/span>igrations.py&#8217;\u548c&#8217;<span style=\"color: #0000ff;\"><strong>dj<\/strong><\/span>ango_ad<span style=\"color: #0000ff;\"><strong>m<\/strong><\/span>in_log.py&#8217;\uff0c\u800c\u6700\u7b80\u5355\u7684\u5b9e\u73b0\u65b9\u6cd5\u5c31\u662f\u4f7f\u7528\u6b63\u5219\u8868\u8fbe\u5f0f\u3002<\/p>\n<h5>\u89e3\u51b3\u65b9\u6848\uff1a<\/h5>\n<h6>1.\u5e38\u89c4\u7684\u6b63\u5219\u5339\u914d\uff1a<\/h6>\n<p>\u5c06&#8217;djm&#8217;\u8f6c\u6362\u6210&#8217;d.*j.*m&#8217;\u7136\u540e\u7528\u8fd9\u4e2a\u6b63\u5219\u5c1d\u8bd5\u5339\u914d\u96c6\u5408\u4e2d\u7684\u6bcf\u4e00\u4e2a\u5b57\u7b26\u4e32\uff0c\u5982\u679c\u5339\u914d\u5230\u4e86\u5c31\u88ab\u5217\u4e3a\u5019\u9009\u3002<\/p>\n<pre class=\"lang:default decode:true\">&gt;&gt;&gt; import re\n&gt;&gt;&gt; def fuzzyfinder(user_input, collection):\n        suggestions = []\n        pattern = '.*'.join(user_input) # Converts 'djm' to 'd.*j.*m'\n        regex = re.compile(pattern)     # Compiles a regex.\n        for item in collection:\n            match = regex.search(item)  # Checks if the current item matches the regex.\n            if match:\n                suggestions.append(item)\n        return suggestions\n\n&gt;&gt;&gt; print fuzzyfinder('djm', collection)\n['django_migrations.py', 'django_admin_log.py']\n\n&gt;&gt;&gt; print fuzzyfinder('mig', collection)\n['django_migrations.py', 'django_admin_log.py', 'main_generator.py', 'migrations.py']<\/pre>\n<p>\u8fd9\u91cc\u6839\u636e\u7528\u6237\u7684\u8f93\u5165\u6211\u4eec\u5f97\u5230\u4e86\u4e00\u4e2a\u63a8\u8350\u5217\u8868\uff0c\u4f46\u662f\u63a8\u8350\u5217\u8868\u4e2d\u7684\u5b57\u7b26\u4e32\u662f\u6ca1\u6709\u8fdb\u884c\u91cd\u8981\u6027\u533a\u5206\u7684\u3002\u6709\u53ef\u80fd\u51fa\u73b0\u6700\u5408\u9002\u7684\u5339\u914d\u9879\u88ab\u653e\u5230\u4e86\u6700\u540e\u7684\u60c5\u51b5\u3002<\/p>\n<p>\u5b9e\u9645\u4e0a\uff0c\u8fd8\u662f\u8fd9\u4e2a\u4f8b\u5b50\uff0c\u5f53\u7528\u6237\u8f93\u5165&#8217;mig&#8217;\u65f6\uff0c\u6700\u4f73\u9009\u9879&#8217;<span style=\"color: #0000ff;\"><strong>mig<\/strong><\/span>rations.py&#8217;\u5c31\u88ab\u653e\u5230\u4e86\u6700\u540e\u3002<\/p>\n<h6>2.\u5e26\u6709rank\u6392\u5e8f\u7684\u5339\u914d\u5217\u8868<\/h6>\n<p>\u8fd9\u91cc\u6211\u4eec\u5bf9\u5339\u914d\u5230\u7684\u7ed3\u679c\u6309\u7167\u5339\u914d\u5185\u5bb9\u7b2c\u4e00\u6b21\u51fa\u73b0\u7684\u8d77\u59cb\u4f4d\u7f6e\u6765\u8fdb\u884c\u6392\u5e8f\u3002<\/p>\n<pre class=\"lang:default decode:true\">'main_generator.py'     - 0\n'migrations.py'         - 0\n'django_migrations.py'  - 7\n'django_admin_log.py'   - 9<\/pre>\n<p>\u4e0b\u9762\u662f\u76f8\u5173\u4ee3\u7801\uff1a<\/p>\n<pre class=\"lang:default decode:true\">&gt;&gt;&gt; import re\n&gt;&gt;&gt; def fuzzyfinder(user_input, collection):\n        suggestions = []\n        pattern = '.*'.join(user_input) # Converts 'djm' to 'd.*j.*m'\n        regex = re.compile(pattern)     # Compiles a regex.\n        for item in collection:\n            match = regex.search(item)  # Checks if the current item matches the regex.\n            if match:\n                suggestions.append((match.start(), item))\n        return [x for _, x in sorted(suggestions)]\n\n&gt;&gt;&gt; print fuzzyfinder('mig', collection)\n['main_generator.py', 'migrations.py', 'django_migrations.py', 'django_admin_log.py']<\/pre>\n<p>\u8fd9\u6b21\u6211\u4eec\u751f\u6210\u4e86\u4e00\u4e2a\u7531\u4e8c\u5143tuple\u7ec4\u6210\u7684\u5217\u8868\uff0c\u5373\u5217\u8868\u4e2d\u7684\u6bcf\u4e00\u4e2a\u5143\u7d20\u4e3a\u4e00\u4e2a\u4e8c\u5143tuple\uff0c\u800c\u8be5\u4e8c\u5143tuple\u7684\u7b2c\u4e00\u4e2a\u503c\u4e3a\u5339\u914d\u5230\u7684\u8d77\u59cb\u4f4d\u7f6e\u3001\u7b2c\u4e8c\u4e2a\u503c\u4e3a\u5bf9\u5e94\u7684\u6587\u4ef6\u540d\uff0c\u7136\u540e\u4f7f\u7528\u5217\u8868\u63a8\u5bfc\u5f0f\u6309\u7167\u5339\u914d\u5230\u7684\u4f4d\u7f6e\u8fdb\u884c\u6392\u5e8f\u5e76\u8fd4\u56de\u6587\u4ef6\u540d\u5217\u8868\u3002<\/p>\n<p>\u73b0\u5728\u6211\u4eec\u5df2\u7ecf\u5f88\u63a5\u8fd1\u6700\u7ec8\u7684\u7ed3\u679c\u4e86\uff0c\u4f46\u8fd8\u79f0\u4e0d\u4e0a\u5b8c\u7f8e\u2014\u2014\u7528\u6237\u60f3\u8981\u7684\u662f&#8217;<span style=\"color: #0000ff;\"><strong>mig<\/strong><\/span>ration.py&#8217;\uff0c\u4f46\u6211\u4eec\u5374\u628a&#8217;main_generator.py&#8217;\u4f5c\u4e3a\u7b2c\u4e00\u63a8\u8350\u3002<\/p>\n<h6>3.\u6839\u636e\u5339\u914d\u7684\u7d27\u51d1\u7a0b\u5ea6\u8fdb\u884c\u6392\u5e8f<\/h6>\n<p>\u5f53\u7528\u6237\u5f00\u59cb\u8f93\u5165\u4e00\u4e2a\u5b57\u7b26\u4e32\u65f6\uff0c\u4ed6\u4eec\u503e\u5411\u4e8e\u8f93\u5165\u8fde\u7eed\u7684\u5b57\u7b26\u4ee5\u8fdb\u884c\u7cbe\u786e\u5339\u914d\u3002\u6bd4\u5982\u5f53\u7528\u6237\u8f93\u5165&#8217;mig&#8217;\u4ed6\u4eec\u66f4\u503e\u5411\u4e8e\u627e\u7684\u662f&#8217;<span style=\"color: #0000ff;\"><strong>mig<\/strong><\/span>rations.py&#8217;\u6216&#8217;django_<span style=\"color: #0000ff;\"><strong>mig<\/strong><\/span>rations.py&#8217;\uff0c\u800c\u4e0d\u662f&#8217;main_generator.py&#8217;\uff0c\u6240\u4ee5\u8fd9\u91cc\u6211\u4eec\u6240\u505a\u7684\u6539\u53d8\u5c31\u662f\u67e5\u627e\u5339\u914d\u5230\u7684\u6700\u7d27\u51d1\u7684\u9879\u76ee\u3002<\/p>\n<p>\u521a\u624d\u63d0\u5230\u7684\u95ee\u9898\u5bf9\u4e8ePython\u6765\u8bf4\u4e0d\u7b97\u4ec0\u4e48\u4e8b\uff0c\u56e0\u4e3a\u5f53\u6211\u4eec\u4f7f\u7528\u6b63\u5219\u8868\u8fbe\u5f0f\u8fdb\u884c\u5b57\u7b26\u4e32\u5339\u914d\u65f6\uff0c\u5339\u914d\u5230\u7684\u5b57\u7b26\u4e32\u5c31\u5df2\u7ecf\u88ab\u5b58\u653e\u5728\u4e86match.group()\u4e2d\u4e86\u3002\u4e0b\u9762\u5047\u8bbe\u8f93\u5165\u4e3a&#8217;mig&#8217;\uff0c\u5bf9\u6700\u521d\u5b9a\u4e49\u7684&#8217;collection&#8217;\u7684\u5339\u914d\u7ed3\u679c\u5982\u4e0b\uff1a<\/p>\n<pre class=\"lang:default decode:true\">regex = '(m.*i.*g)'\n\n'main_generator.py'    -&gt;  'main_g'\n'migrations.py'        -&gt;  'mig'\n'django_migrations.py' -&gt;  'mig'\n'django_admin_log.py'  -&gt;  'min_log'<\/pre>\n<p>\u8fd9\u91cc\u6211\u4eec\u5c06\u63a8\u8350\u5217\u8868\u505a\u6210\u4e86\u4e09\u5143tuple\u7684\u5217\u8868\u7684\u5f62\u5f0f\uff0c\u5373\u63a8\u8350\u5217\u8868\u4e2d\u7684\u6bcf\u4e00\u4e2a\u5143\u7d20\u4e3a\u4e00\u4e2a\u4e09\u5143tuple\uff0c\u800c\u8be5\u4e09\u5143tuple\u7684\u7b2c\u4e00\u4e2a\u503c\u4e3a<span style=\"color: #ff0000;\"><strong>\u5339\u914d\u5230\u7684\u5185\u5bb9\u7684\u957f\u5ea6<\/strong><\/span>\u3001\u7b2c\u4e8c\u4e2a\u503c\u4e3a<strong><span style=\"color: #ff0000;\">\u5339\u914d\u5230\u7684\u8d77\u59cb\u4f4d\u7f6e<\/span><\/strong>\u3001\u7b2c\u4e09\u4e2a\u503c\u4e3a<strong>\u5bf9\u5e94\u7684\u6587\u4ef6\u540d<\/strong>\uff0c\u7136\u540e\u6309\u7167\u5339\u914d\u957f\u5ea6\u548c\u8d77\u59cb\u4f4d\u7f6e\u8fdb\u884c\u6392\u5e8f\u5e76\u8fd4\u56de\u3002<\/p>\n<pre class=\"lang:default decode:true\">&gt;&gt;&gt; import re\n&gt;&gt;&gt; def fuzzyfinder(user_input, collection):\n        suggestions = []\n        pattern = '.*'.join(user_input) # Converts 'djm' to 'd.*j.*m'\n        regex = re.compile(pattern)     # Compiles a regex.\n        for item in collection:\n            match = regex.search(item)  # Checks if the current item matches the regex.\n            if match:\n                suggestions.append((len(match.group()), match.start(), item))\n        return [x for _, _, x in sorted(suggestions)]\n\n&gt;&gt;&gt; print fuzzyfinder('mig', collection)\n['migrations.py', 'django_migrations.py', 'main_generator.py', 'django_admin_log.py']<\/pre>\n<p>\u9488\u5bf9\u6211\u4eec\u7684\u8f93\u5165\uff0c\u8fd9\u65f6\u5019\u7684\u5339\u914d\u7ed3\u679c\u5df2\u7ecf\u8d8b\u5411\u4e8e\u5b8c\u7f8e\u4e86\uff0c\u4e0d\u8fc7\u8fd8\u6ca1\u5b8c\u3002<\/p>\n<h6>4.\u975e\u8d2a\u5a6a\u5339\u914d<\/h6>\n<p>\u7531 <a href=\"https:\/\/github.com\/drocco007\" target=\"_blank\">Daniel Rocco<\/a> \u53d1\u73b0\u4e86\u8fd9\u4e00\u5fae\u5999\u7684\u95ee\u9898\uff1a\u5f53\u96c6\u5408\u4e2d\u6709[&#8216;api_<span style=\"color: #0000ff;\"><strong>user<\/strong><\/span>&#8216;, &#8216;<span style=\"color: #0000ff;\"><strong>user<\/strong><\/span>_group&#8217;]\u8fd9\u4e24\u4e2a\u5143\u7d20\u5b58\u5728\uff0c\u7528\u6237\u8f93\u5165&#8217;user&#8217;\u65f6\uff0c\u9884\u671f\u7684\u5339\u914d\u7ed3\u679c(\u76f8\u5bf9\u987a\u5e8f)\u5e94\u8be5\u4e3a[&#8216;user_group&#8217;, &#8216;api_user&#8217;]\uff0c\u4f46\u5b9e\u9645\u4e0a\u7684\u7ed3\u679c\u4e3a\uff1a<\/p>\n<pre class=\"lang:default decode:true\">&gt;&gt;&gt; print fuzzyfinder('user', collection)\n['api_user.doc', 'user_group.doc']<\/pre>\n<p>\u4e0a\u9762\u7684\u6d4b\u8bd5\u7ed3\u679c\u4e2d\uff1a&#8217;api_user&#8217;\u8981\u6392\u5728&#8217;user_group&#8217;\u524d\u9762\u3002\u6df1\u5165\u4e00\u70b9\uff0c\u6211\u4eec\u53d1\u73b0\u8fd9\u662f\u56e0\u4e3a\u5728\u641c\u7d22&#8217;user&#8217;\u65f6\uff0c\u6b63\u5219\u88ab\u6269\u5c55\u6210\u4e86&#8217;u.*s.*e.*r&#8217;\uff0c\u8003\u8651\u5230&#8217;user_group&#8217;\u67092\u4e2a&#8217;rs&#8217;\uff0c\u56e0\u6b64\u8be5\u6a21\u5f0f\u5339\u914d\u5230\u4e86&#8217;<span style=\"color: #0000ff;\"><strong>user_gr<\/strong><\/span>&#8216;\u800c\u4e0d\u662f\u6211\u4eec\u9884\u671f\u7684&#8217;<span style=\"color: #0000ff;\"><strong>user<\/strong><\/span>&#8216;\u3002\u66f4\u957f\u7684\u5339\u914d\u5bfc\u81f4\u5728\u6700\u540e\u7684\u5339\u914drank\u6392\u5e8f\u65f6\u540d\u6b21\u4e0b\u964d\u8fd9\u4e00\u8fdd\u53cd\u76f4\u89c9\u7684\u7ed3\u679c\uff0c\u4e0d\u8fc7\u8fd9\u95ee\u9898\u4e5f\u5bb9\u6613\u89e3\u51b3\uff0c\u5c06\u6b63\u5219\u4fee\u6539\u4e3a&#8217;\u975e\u8d2a\u5a6a\u5339\u914d&#8217;\u5373\u53ef\u3002<\/p>\n<pre class=\"lang:default decode:true\">&gt;&gt;&gt; import re\n&gt;&gt;&gt; def fuzzyfinder(user_input, collection):\n        suggestions = []\n        pattern = '.*?'.join(user_input)    # Converts 'djm' to 'd.*?j.*?m'\n        regex = re.compile(pattern)         # Compiles a regex.\n        for item in collection:\n            match = regex.search(item)      # Checks if the current item matches the regex.\n            if match:\n                suggestions.append((len(match.group()), match.start(), item))\n        return [x for _, _, x in sorted(suggestions)]\n\n&gt;&gt;&gt; fuzzyfinder('user', collection)\n['user_group.doc', 'api_user.doc']\n\n&gt;&gt;&gt; print fuzzyfinder('mig', collection)\n['migrations.py', 'django_migrations.py', 'main_generator.py', 'django_admin_log.py']<\/pre>\n<p>\u73b0\u5728\uff0cfuzzyfinder\u5df2\u7ecf\u53ef\u4ee5(\u5728\u4e0a\u9762\u7684\u60c5\u51b5\u4e2d)\u6b63\u5e38\u5de5\u4f5c\u4e86\uff0c\u800c\u6211\u4eec\u4e0d\u8fc7\u53ea\u5199\u4e8610\u884c\u4ee3\u7801\u5c31\u5b9e\u73b0\u4e86\u4e00\u4e2a fuzzy finder\u3002<\/p>\n<h6>\u7ed3\u8bba\uff1a<\/h6>\n<p>\u4ee5\u4e0a\u5c31\u662f\u6211\u5728\u6211\u7684 <a href=\"https:\/\/github.com\/dbcli\/pgcli\/blob\/amjith\/fuzzy_completion\/pgcli\/pgcompleter.py#L198..L204\" target=\"_blank\">pgcli<\/a> \u9879\u76ee(\u4e00\u4e2a\u6709\u81ea\u52a8\u8865\u5168\u529f\u80fd\u7684Postgresql\u547d\u4ee4\u884c\u5b9e\u73b0)\u4e2d\u8bbe\u8ba1\u5b9e\u73b0&#8217;fuzzy matching&#8217;\u7684\u8fc7\u7a0b\u8bb0\u5f55\u3002<\/p>\n<p>\u6211\u5df2\u7ecf\u5c06 <a href=\"https:\/\/github.com\/amjith\/fuzzyfinder\" target=\"_blank\">fuzzyfinder<\/a> \u63d0\u53d6\u6210\u4e00\u4e2a\u72ec\u7acb\u7684Python\u5305\uff0c\u4f60\u53ef\u4ee5\u4f7f\u7528\u547d\u4ee4&#8217;pip install fuzzyfinder&#8217;\u5728\u4f60\u7684\u9879\u76ee\u4e2d\u8fdb\u884c\u5b89\u88c5\u548c\u4f7f\u7528\u3002<\/p>\n<p>\u611f\u8c22 <a href=\"https:\/\/github.com\/zoltu\" target=\"_blank\">Micah Zoltu<\/a> \u548c <a href=\"https:\/\/github.com\/drocco007\" target=\"_blank\">Daniel Rocco<\/a> \u5bf9\u7b97\u6cd5\u7684\u68c0\u67e5\u548c\u95ee\u9898\u4fee\u590d\u3002<\/p>\n<p>\u5982\u679c\u4f60\u5bf9\u8fd9\u4e2a\u611f\u5174\u8da3\u7684\u8bdd\uff0c\u4f60\u53ef\u4ee5\u6765 <a href=\"https:\/\/twitter.com\/amjithr\" target=\"_blank\">twitter<\/a> \u4e0a\u627e\u6211\u3002<\/p>\n<h6>\u7ed3\u8bed\uff1a<\/h6>\n<p>\u5f53\u6211\u7b2c\u4e00\u6b21\u8003\u8651\u7528Python\u5b9e\u73b0&#8217;fuzzy matching&#8217;\u7684\u65f6\u5019\uff0c\u6211\u5c31\u77e5\u9053\u4e00\u4e2a\u53eb\u505a <a href=\"https:\/\/github.com\/seatgeek\/fuzzywuzzy\" target=\"_blank\">fuzzywuzzy<\/a> \u7684\u4f18\u79c0\u5e93\uff0c\u4f46\u662f fuzzywuzzy \u7684\u505a\u6cd5\u548c\u8fd9\u91cc\u7684\u4e0d\u592a\u4e00\u6837\uff0c\u5b83\u4f7f\u7528\u7684\u662f &#8216;<a href=\"https:\/\/en.wikipedia.org\/wiki\/Levenshtein_distance\" target=\"_blank\">levenshtein distance<\/a>&#8216; \u6765\u4ece\u96c6\u5408\u4e2d\u627e\u5230\u6700\u5339\u914d\u7684\u5b57\u7b26\u4e32\u3002&#8217;levenshtein distance&#8217;\u662f\u4e00\u4e2a\u975e\u5e38\u9002\u5408\u7528\u6765\u505a\u81ea\u52a8\u66f4\u6b63\u62fc\u5199\u9519\u8bef\u7684\u6280\u672f\uff0c\u4f46\u5728\u4ece\u90e8\u5206\u5b50\u4e32\u5339\u914d\u957f\u6587\u4ef6\u540d\u65f6\u8868\u73b0\u7684\u4e0d\u592a\u597d(\u6240\u4ee5\u8fd9\u91cc\u6ca1\u6709\u4f7f\u7528)\u3002<\/p>\n<p><strong>\u82f1\u6587\u539f\u6587<\/strong>\uff1a<a href=\"http:\/\/blog.amjith.com\/fuzzyfinder-in-10-lines-of-python\" target=\"_blank\">http:\/\/blog.amjith.com\/fuzzyfinder-in-10-lines-of-python<\/a><\/p>\n<p>=EOF=<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u5bfc\u8bed\uff1a \u6a21\u7cca\u5339\u914d\u53ef\u4ee5\u7b97\u662f\u73b0\u4ee3\u7f16\u8f91\u5668(\u5728\u9009\u62e9\u6253\u5f00\u6587\u4ef6\u65f6)\u7684\u4e00\u4e2a\u5fc5\u5907\u7279\u6027\u4e86\uff0c\u5b83\u6240\u505a\u7684\u5c31\u662f\u6839\u636e\u7528\u6237\u8f93\u5165\u7684\u90e8\u5206\u5185\u5bb9\u731c\u6d4b [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[7,12],"tags":[541,8,19],"class_list":["post-2409","post","type-post","status-publish","format-standard","hentry","category-programing","category-tools","tag-fuzzy","tag-python","tag-tips"],"views":2252,"_links":{"self":[{"href":"https:\/\/ixyzero.com\/blog\/wp-json\/wp\/v2\/posts\/2409","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ixyzero.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ixyzero.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ixyzero.com\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/ixyzero.com\/blog\/wp-json\/wp\/v2\/comments?post=2409"}],"version-history":[{"count":0,"href":"https:\/\/ixyzero.com\/blog\/wp-json\/wp\/v2\/posts\/2409\/revisions"}],"wp:attachment":[{"href":"https:\/\/ixyzero.com\/blog\/wp-json\/wp\/v2\/media?parent=2409"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ixyzero.com\/blog\/wp-json\/wp\/v2\/categories?post=2409"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ixyzero.com\/blog\/wp-json\/wp\/v2\/tags?post=2409"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}