Initial commit
This commit is contained in:
commit
3c5cd937a8
1
.gitignore
vendored
Normal file
1
.gitignore
vendored
Normal file
@ -0,0 +1 @@
|
||||
result*
|
26
flake.lock
generated
Normal file
26
flake.lock
generated
Normal file
@ -0,0 +1,26 @@
|
||||
{
|
||||
"nodes": {
|
||||
"nixpkgs": {
|
||||
"locked": {
|
||||
"lastModified": 1679710833,
|
||||
"narHash": "sha256-9yKVvGX1oAnlc8vTVvN2lRH35q6ETudQbM1w9ragMRU=",
|
||||
"owner": "NixOS",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "83607dae4e05e1de755bbc7d7949b33fc1cfbbb9",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"id": "nixpkgs",
|
||||
"ref": "nixos-22.11",
|
||||
"type": "indirect"
|
||||
}
|
||||
},
|
||||
"root": {
|
||||
"inputs": {
|
||||
"nixpkgs": "nixpkgs"
|
||||
}
|
||||
}
|
||||
},
|
||||
"root": "root",
|
||||
"version": 7
|
||||
}
|
30
flake.nix
Normal file
30
flake.nix
Normal file
@ -0,0 +1,30 @@
|
||||
{
|
||||
inputs = {
|
||||
nixpkgs.url = "nixpkgs/nixos-22.11";
|
||||
};
|
||||
|
||||
outputs = { self, nixpkgs }: let
|
||||
system = "x86_64-linux";
|
||||
pkgs = nixpkgs.legacyPackages.${system};
|
||||
in {
|
||||
packages.${system} = {
|
||||
unidic = pkgs.callPackage ./nix/unidic.nix pkgs.python3Packages;
|
||||
};
|
||||
|
||||
devShells.${system}.default = pkgs.mkShell {
|
||||
packages = with pkgs; [
|
||||
mecab
|
||||
] ++ (with pkgs.python3Packages; [
|
||||
# flask
|
||||
# flask-cors
|
||||
mecab-python3
|
||||
nltk
|
||||
pandas
|
||||
# pip
|
||||
python
|
||||
scikit-learn
|
||||
spacy
|
||||
]);
|
||||
};
|
||||
};
|
||||
}
|
43
nix/unidic.nix
Normal file
43
nix/unidic.nix
Normal file
@ -0,0 +1,43 @@
|
||||
{ lib
|
||||
, buildPythonPackage
|
||||
, fetchPypi
|
||||
, requests
|
||||
, tqdm
|
||||
, wasabi
|
||||
, plac
|
||||
, ...
|
||||
# , mecab
|
||||
# , swig
|
||||
# , setuptools-scm
|
||||
}:
|
||||
|
||||
buildPythonPackage rec {
|
||||
pname = "unidic";
|
||||
version = "1.1.0";
|
||||
|
||||
src = fetchPypi {
|
||||
inherit pname version;
|
||||
sha256 = "CrkcBd40LITSpjFJAf06+5Bh7NdTTdSgQx3Mu4fZIbc=";
|
||||
};
|
||||
|
||||
nativeBuildInputs = [
|
||||
requests
|
||||
tqdm
|
||||
wasabi
|
||||
plac
|
||||
# mecab # for mecab-config
|
||||
# swig
|
||||
# setuptools-scm
|
||||
];
|
||||
|
||||
# buildInputs = [ mecab ];
|
||||
|
||||
# doCheck = false;
|
||||
|
||||
# meta = with lib; {
|
||||
# description = "A python wrapper for mecab: Morphological Analysis engine";
|
||||
# homepage = "https://github.com/SamuraiT/mecab-python3";
|
||||
# license = with licenses; [ gpl2 lgpl21 bsd3 ]; # any of the three
|
||||
# maintainers = with maintainers; [ ixxie ];
|
||||
# };
|
||||
}
|
0
src/lmao.txt
Normal file
0
src/lmao.txt
Normal file
11
src/main.py
Normal file
11
src/main.py
Normal file
@ -0,0 +1,11 @@
|
||||
import MeCab
|
||||
tagger = MeCab.Tagger()
|
||||
|
||||
parsed = tagger.parse("pythonが大好きです")
|
||||
print(parsed.split())
|
||||
|
||||
parsed = parsed.encode('utf-16').decode('unicode-escape')
|
||||
|
||||
# with open("lmao.txt", "w") as file:
|
||||
# file.write(parsed)
|
||||
print(parsed)
|
Loading…
Reference in New Issue
Block a user