インストール手順
$ sudo apt-get install mecab libmecab-dev mecab-ipadic
$ sudo aptitude install mecab-ipadic-utf8
$ sudo apt-get install python-mecab
#!/usr/bin/env python | |
# -*- coding:utf-8 -*- | |
import re | |
import MeCab | |
class Word(object): | |
def __init__(self,surface,feature): | |
self.surface = surface | |
self.feature = feature |
# -*- coding: utf-8 -*- | |
ARGV.each do |fn| | |
lines = File.readlines(fn) | |
hiki = lines.map { |l| | |
l.sub(/^(#+)\s/){ '!'*($1.length) + ' ' }. | |
sub(/^(-+)\s/){ '*'*($1.length) + ' ' }. | |
gsub(/\!\[([^\]]+)\]\(([^\)]+)\)/){ $2[0..3] == 'http' ? $2 : ('http://goos-lokka.heroku.com' + $2) }. # picture | |
gsub(/\[([^\]]+)\]\(([^\)]+)\)/, '[[\1|\2]]'). # url | |
gsub(/\*\*([^*]*)\*\*/, "'''\\1'''"). | |
sub(/^ /, ' '). |
@Configuration | |
public class SnakeCaseApplicationConfiguration { | |
@Bean | |
public OncePerRequestFilter snakeCaseConverterFilter() { | |
return new OncePerRequestFilter() { | |
@Override | |
protected void doFilterInternal(HttpServletRequest request, HttpServletResponse response, FilterChain filterChain) throws ServletException, IOException { | |
final Map<String, String[]> parameters = new ConcurrentHashMap<>(); | |
for (String param : request.getParameterMap().keySet()) { |