例如,我定义了一个名为{
"$schema": "http://json-schema.org/draft-07/schema",
"type": "array",
"items": {
"type": "array"
}
}
的架构,例如:
{"$schema": "../stringArray.json"}
当我编写json时,如何引用架构文件,例如使用# extract_tokens.py
def extract_tokens(text,ngrams,stem):
"""This function takes selftext from a Reddit post, strips URLs, newline formatting strings,
and non alphabetic characters, removes stopwords, and returns a lower case list of words """
import re
from nltk.corpus import stopwords as sw
from nltk.stem.snowball import SnowballStemmer
text=text.lower()
...
# Remove stopwords (from nltk)
s_words=sw.words('english')
if stem==1:
Stemmer=SnowballStemmer("english")
?