Mid class 4
This commit is contained in:
parent
20cfca6657
commit
0af0de7ec7
|
@ -0,0 +1,139 @@
|
|||
{
|
||||
"animals":
|
||||
[
|
||||
"aardvark",
|
||||
"alligator",
|
||||
"alpaca",
|
||||
"antelope",
|
||||
"ape",
|
||||
"armadillo",
|
||||
"baboon",
|
||||
"badger",
|
||||
"bat",
|
||||
"bear",
|
||||
"beaver",
|
||||
"bison",
|
||||
"boar",
|
||||
"buffalo",
|
||||
"bull",
|
||||
"camel",
|
||||
"canary",
|
||||
"capybara",
|
||||
"cat",
|
||||
"chameleon",
|
||||
"cheetah",
|
||||
"chimpanzee",
|
||||
"chinchilla",
|
||||
"chipmunk",
|
||||
"cougar",
|
||||
"cow",
|
||||
"coyote",
|
||||
"crocodile",
|
||||
"crow",
|
||||
"deer",
|
||||
"dingo",
|
||||
"dog",
|
||||
"donkey",
|
||||
"dromedary",
|
||||
"elephant",
|
||||
"elk",
|
||||
"ewe",
|
||||
"ferret",
|
||||
"finch",
|
||||
"fish",
|
||||
"fox",
|
||||
"frog",
|
||||
"gazelle",
|
||||
"gila monster",
|
||||
"giraffe",
|
||||
"gnu",
|
||||
"goat",
|
||||
"gopher",
|
||||
"gorilla",
|
||||
"grizzly bear",
|
||||
"ground hog",
|
||||
"guinea pig",
|
||||
"hamster",
|
||||
"hedgehog",
|
||||
"hippopotamus",
|
||||
"hog",
|
||||
"horse",
|
||||
"hyena",
|
||||
"ibex",
|
||||
"iguana",
|
||||
"impala",
|
||||
"jackal",
|
||||
"jaguar",
|
||||
"kangaroo",
|
||||
"koala",
|
||||
"lamb",
|
||||
"lemur",
|
||||
"leopard",
|
||||
"lion",
|
||||
"lizard",
|
||||
"llama",
|
||||
"lynx",
|
||||
"mandrill",
|
||||
"marmoset",
|
||||
"mink",
|
||||
"mole",
|
||||
"mongoose",
|
||||
"monkey",
|
||||
"moose",
|
||||
"mountain goat",
|
||||
"mouse",
|
||||
"mule",
|
||||
"muskrat",
|
||||
"mustang",
|
||||
"mynah bird",
|
||||
"newt",
|
||||
"ocelot",
|
||||
"opossum",
|
||||
"orangutan",
|
||||
"oryx",
|
||||
"otter",
|
||||
"ox",
|
||||
"panda",
|
||||
"panther",
|
||||
"parakeet",
|
||||
"parrot",
|
||||
"pig",
|
||||
"platypus",
|
||||
"polar bear",
|
||||
"porcupine",
|
||||
"porpoise",
|
||||
"prairie dog",
|
||||
"puma",
|
||||
"rabbit",
|
||||
"raccoon",
|
||||
"ram",
|
||||
"rat",
|
||||
"reindeer",
|
||||
"reptile",
|
||||
"rhinoceros",
|
||||
"salamander",
|
||||
"seal",
|
||||
"sheep",
|
||||
"shrew",
|
||||
"silver fox",
|
||||
"skunk",
|
||||
"sloth",
|
||||
"snake",
|
||||
"squirrel",
|
||||
"tapir",
|
||||
"tiger",
|
||||
"toad",
|
||||
"turtle",
|
||||
"walrus",
|
||||
"warthog",
|
||||
"weasel",
|
||||
"whale",
|
||||
"wildcat",
|
||||
"wolf",
|
||||
"wolverine",
|
||||
"wombat",
|
||||
"woodchuck",
|
||||
"yak",
|
||||
"zebra"
|
||||
]
|
||||
}
|
File diff suppressed because it is too large
Load Diff
|
@ -15,6 +15,7 @@ const concat = require('concat-stream');
|
|||
const xml2object = require('xml2object');
|
||||
const appRoot = require('app-root-path');
|
||||
const natural = require('natural');
|
||||
const animals = require(appRoot + '/data/common.json');
|
||||
|
||||
//Path to your darta directory
|
||||
var dataPath = appRoot + "/data";
|
||||
|
@ -106,10 +107,12 @@ var allRecords = [];
|
|||
var t = record.Title.join(" ");
|
||||
|
||||
//Check this string for some seed words
|
||||
var chk = checkForWords(t, ["frog"]);
|
||||
var chk = checkForWords(t, animals.animals);
|
||||
if (chk.chk) {
|
||||
console.log(chk.w + ":" + t);
|
||||
chk.Title = t;
|
||||
chk.Year = record.Year;
|
||||
chk.URL = record.URL;
|
||||
outList.push(chk);
|
||||
}
|
||||
|
||||
|
@ -123,7 +126,7 @@ var allRecords = [];
|
|||
function checkForWords(_r, _w) {
|
||||
var chk = {chk:false, w:null};
|
||||
for (var i = 0; i < _w.length; i++) {
|
||||
if (_r.indexOf(_w[i]) != -1) {
|
||||
if (_r.indexOf(' ' + _w[i] + ' ') != -1) {
|
||||
chk.chk = true;
|
||||
chk.w = _w[i];
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue