Datasets:

Modalities:
Text
Formats:
text
Size:
< 1K
ArXiv:
Libraries:
Datasets
RepoZero-Py2JS / whoosh /test5.py
jessezhaoxizhang's picture
Duplicate from jessezhaoxizhang/RepoZero-Py2JS
a839836
Raw
History Blame Contribute Delete
390 Bytes
import argparse
from whoosh.fields import Schema, TEXT, ID
from whoosh.analysis import SimpleAnalyzer
parser = argparse.ArgumentParser()
parser.add_argument('--a', type=str, required=True)
args = parser.parse_args()
analyzer = SimpleAnalyzer() # Create simple analyzer
tokens = [token.text for token in analyzer(args.a)] # Tokenize input string using simple analyzer
print(len(tokens))