>>> from importlib import metadata
>>> metadata.packages_distributions()
{'pip': ['pip'], 'MeCab': ['mecab'], '_MeCab': ['mecab']}
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
files: ^backend/.*$ | |
repos: | |
- repo: https://github.com/astral-sh/ruff-pre-commit | |
# Ruff version. | |
rev: v0.3.7 | |
hooks: | |
# Run the linter. | |
- id: ruff | |
types_or: [python, pyi, jupyter] | |
args: [--fix] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
import time | |
import urllib.request | |
import zipfile | |
import pandas as pd | |
from pandarallel import pandarallel | |
URL = "https://www.post.japanpost.jp/zipcode/dl/utf/zip/utf_ken_all.zip" | |
ZIP_FILE_NAME = URL.split("/")[-1] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <stdlib.h> | |
#define NUM_PATTERN 5 | |
#define MAX_LENGTH 255 | |
char user_input; | |
int idx; | |
char response[NUM_PATTERN][MAX_LENGTH]={ | |
{"さすがですね!"}, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import re | |
import sqlite3 | |
import time | |
import requests | |
DB_PATH = 'wnjpn.db' | |
SWN_PATH = 'SentiWordNet_3.0.0_20130122.txt' | |
URL = 'https://script.google.com/macros/s/Please_write_here/exec?text=%s&source=en&target=ja' | |
RESULT_PATH = 'result.csv' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/sh | |
git clone --depth=1 -b patch https://github.com/humem/cabocha /tmp/cabocha | |
cd /tmp/cabocha | |
./configure --with-charset=utf8 | |
make | |
make install | |
pip install git+https://github.com/taku910/cabocha.git#subdirectory=python |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# The MIT License (MIT) | |
# Copyright © 2015 Recruit Technologies Co.,Ltd. | |
# | |
# Permission is hereby granted, free of charge, to any person obtaining a copy | |
# of this software and associated documentation files (the "Software"), to deal | |
# in the Software without restriction, including without limitation the rights | |
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
# copies of the Software, and to permit persons to whom the Software is | |
# furnished to do so, subject to the following conditions: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import glob | |
import html | |
import re | |
import sys | |
import jaconv | |
re_ogt = re.compile(' OrthographicTranscription="([^"]+)"') | |
re_a = re.compile('\;([^\)]+)\)?') | |
re_semicolon = re.compile(';([^\)]+)\)?') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def mergesort(l): | |
if len(l) > 1: | |
mid = len(l) // 2 | |
left = l[:mid] | |
right = l[mid:] | |
left = mergesort(left) | |
right = mergesort(right) | |
i = 0 |
NewerOlder