This file contains 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 | |
# encoding: utf-8 | |
''' | |
printver -- print version and date of python modules | |
print module's __version__, __date__ and __updated__ variable | |
:author: Liu Xue Yan | |
:mail: tanbro@163.com | |
''' |
This file contains 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
/* | |
============================================================================ | |
Name : StringSplit.c | |
Author : | |
Version : | |
Copyright : | |
Description : Hello World in C, Ansi-style | |
============================================================================ | |
*/ |
This file contains 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 | |
# -*- coding: utf-8 -*- | |
''' | |
Created on 2011-8-29 | |
@author: tanbro | |
''' | |
import os |
This file contains 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
""" | |
Remove line seperator in a text | |
""" | |
import re | |
REMOVE_LINESEP_RE = re.compile(r'(?P<c>[\S])([\r|\n]+)') | |
def remove_linesep(s): # type: (str)->str | |
return re.sub(REMOVE_LINESEP_RE, r'\g<c>', s.strip()) |
This file contains 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 | |
HANZI = r'([\u4E00-\u9FFF]|[\u3400-\u4DBF]|[\U00020000-\U0002A6DF]|[\U0002A700-\U0002B73F]|[\U0002B740-\U0002B81F]|[\U0002B820-\U0002CEAF]|[\uF900-\uFAFF]|[\U0002F800-\U0002FA1F])' | |
CJK_WHITESPACE_REGEX = re.compile(r'(?P<c>[\u2E80-\u9FFF])(\s+)') | |
def remove_cjk_whitespace(s): # type: (str)->str | |
"""删除字符串中 CJK 文字之间的空格 |
This file contains 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
# -*- coding: utf-8 -*- | |
""" | |
使用 CoreNLP 进行汉语语料的分句和分词 | |
""" | |
import os | |
import re | |
import unicodedata | |
import unittest |
This file contains 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
# -*- coding: utf-8 -*- | |
""" | |
Re-Pack `Wheel` to a PYC-Only One | |
""" | |
from __future__ import print_function, unicode_literals | |
import argparse | |
import compileall |
This file contains 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 sys | |
import os | |
try: | |
import fcntl | |
except ImportError: | |
fcntl = None | |
LOCK_PATH = os.path.join(os.path.abspath(os.path.dirname(sys.argv[0])), "lock") | |
OS_WIN = False |
This file contains 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
""" | |
Change dictionary's key naming style | |
""" | |
from typing import Iterable, Mapping | |
import stringcase | |
__all__ = ['convert', 'camelize', 'pascalize', 'snakelize'] |
This file contains 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 <stddef.h> | |
#include <memory.h> | |
#include <openssl/bio.h> | |
#include <openssl/buffer.h> | |
#include <openssl/evp.h> | |
/// 参考: https://www.openssl.org/docs/man1.0.2/man3/BIO_f_base64.html 以及 | |
/// https://gist.github.com/barrysteyn/7308212 |
OlderNewer