Skip to content

Instantly share code, notes, and snippets.

View un1t's full-sized avatar

Ilya Shalyapin un1t

View GitHub Profile
@un1t
un1t / RapidXmlExample.c
Created November 14, 2016 19:30 — forked from JSchaenzle/RapidXmlExample.c
RapidXml example parsing beer journal
#include <string.h>
#include <stdio.h>
#include <iostream>
#include <fstream>
#include <vector>
#include "rapidxml-1.13/rapidxml.hpp"
using namespace rapidxml;
using namespace std;
@un1t
un1t / elasticsearch_ru_stemming_and_morphology.py
Created March 10, 2016 12:10 — forked from svartalf/elasticsearch_ru_stemming_and_morphology.py
Example of the ElasticSearch configuration for russian stemming and morphology
requests.put('http://localhost:9200/site/', data=json.dumps({
'settings': {
'analysis': {
'analyzer': {
'ru': {
'type': 'custom',
'tokenizer': 'standard',
"filter": ['lowercase', 'russian_morphology', 'english_morphology', 'ru_stopwords'],
},
},
from decorator import decorator
from line_profiler import LineProfiler
@decorator
def profile_each_line(func, *args, **kwargs):
profiler = LineProfiler()
profiled_func = profiler(func)
try:
return profiled_func(*args, **kwargs)
finally: