Comparing version
@@ -203,2 +203,88 @@ 'use strict'; | ||
/** | ||
* Returns all the words which fall outside of normal Na'vi phonotactics | ||
* @param {RequestInit | undefined} init fetch options (optional) | ||
* @returns {Promise<Word[][]>} | ||
*/ | ||
async function oddballs(init) { | ||
const url = endpoints.oddballs_url; | ||
const response = await fetch(url, init); | ||
const data = (await response.json()); | ||
return data; | ||
} | ||
/** | ||
* Returns all the words with more than one dictionary entry | ||
* @param {RequestInit | undefined} init fetch options (optional) | ||
* @returns {Promise<Word[][]>} | ||
*/ | ||
async function homonyms(init) { | ||
const url = endpoints.oddballs_url; | ||
const response = await fetch(url, init); | ||
const data = (await response.json()); | ||
return data; | ||
} | ||
/** | ||
* Returns whether or not the given string is valid Na'vi | ||
* @param {RequestInit | undefined} init fetch options (optional) | ||
* @param {string} words words to search | ||
* @returns {Promise<String>} | ||
*/ | ||
async function valid(words, init) { | ||
const url = endpoints.validity_url.replace('{i}', words); | ||
const response = await fetch(url, init); | ||
const data = (await response.json()); | ||
return data; | ||
} | ||
/** | ||
* Returns a string saying how long the dict is | ||
* @param {RequestInit | undefined} init fetch options (optional) | ||
* @returns {Promise<String>} | ||
*/ | ||
async function dictLen(init) { | ||
const url = endpoints.dict_len_url; | ||
const response = await fetch(url, init); | ||
const data = (await response.json()); | ||
return data; | ||
} | ||
/** | ||
* Returns whether or not the given string is valid Na'vi | ||
* @param {RequestInit | undefined} init fetch options (optional) | ||
* @param {string} words words to search | ||
* @returns {Promise<String[]>} | ||
*/ | ||
async function reefMe(words, init) { | ||
const url = endpoints.reef_ipa_url.replace('{i}', words); | ||
const response = await fetch(url, init); | ||
const data = (await response.json()); | ||
return data; | ||
} | ||
/** | ||
* Returns whether or not the given string is valid Na'vi | ||
* @param {RequestInit | undefined} init fetch options (optional) | ||
* @returns {Promise<Map<string,Map<string,Map<string,number>>>>} | ||
*/ | ||
async function phonemeFrequency(init) { | ||
const url = endpoints.reef_ipa_url; | ||
const response = await fetch(url, init); | ||
const data = (await response.json()); | ||
return data; | ||
} | ||
/** | ||
* Returns Na'vi swear words | ||
* @param {RequestInit | undefined} init fetch options (optional) | ||
* @returns {Promise<String[]>} | ||
*/ | ||
async function profanity(init) { | ||
const url = endpoints.reef_ipa_url; | ||
const response = await fetch(url, init); | ||
const data = (await response.json()); | ||
return data | ||
} | ||
/** | ||
* Convert a decimal integer in closed range [0,32767] to Na'vi | ||
@@ -364,2 +450,9 @@ * @param num number to convert to Na'vi; | ||
exports.nameSingle = nameSingle; | ||
exports.oddballs = oddballs; | ||
exports.homonyms = homonyms; | ||
exports.valid = valid; | ||
exports.dictLen = dictLen; | ||
exports.reefMe = reefMe; | ||
exports.phonemeFrequency = phonemeFrequency; | ||
exports.profanity = profanity; | ||
exports.naviToNumber = naviToNumber; | ||
@@ -366,0 +459,0 @@ exports.numberToNavi = numberToNavi; |
@@ -8,2 +8,3 @@ import type { PhonemeFrequencyMap, Word } from './types'; | ||
declare function multiIPA(init?: RequestInit): Promise<Word[][]>; | ||
/** | ||
@@ -15,2 +16,3 @@ * Returns all the words which fall outside of normal Na'vi phonotactics | ||
declare function oddballs(init?: RequestInit): Promise<Word[][]>; | ||
/** | ||
@@ -22,2 +24,3 @@ * Returns all the words with more than one dictionary entry | ||
declare function homonyms(init?: RequestInit): Promise<Word[][]>; | ||
/** | ||
@@ -30,2 +33,3 @@ * Returns whether or not the given string is valid Na'vi | ||
declare function valid(words: string, init?: RequestInit): Promise<String>; | ||
/** | ||
@@ -37,2 +41,3 @@ * Returns a string saying how long the dict is | ||
declare function dictLen(init?: RequestInit): Promise<String>; | ||
/** | ||
@@ -45,2 +50,3 @@ * Returns whether or not the given string is valid Na'vi | ||
declare function reefMe(words: string, init?: RequestInit): Promise<String[]>; | ||
/** | ||
@@ -51,3 +57,12 @@ * Returns whether or not the given string is valid Na'vi | ||
*/ | ||
declare function phonemeFrequency(init?: RequestInit): Promise<PhonemeFrequencyMap>; | ||
export { dictLen, homonyms, multiIPA, oddballs, phonemeFrequency, reefMe, valid }; | ||
declare function phonemeFrequency(init?: RequestInit): Promise<Map<string,Map<string,Map<string,number>>>>; | ||
/** | ||
* Returns all the Na'vi swear words | ||
* @param {RequestInit | undefined} init fetch options (optional) | ||
* @returns {Promise<Word[][]>} | ||
*/ | ||
declare function profanity(init?: RequestInit): Promise<Word[][]>; | ||
export { multiIPA, oddballs, homonyms, valid, dictLen, reefMe, phonemeFrequency, profanity }; |
{ | ||
"name": "fwew.js", | ||
"version": "2.5.2", | ||
"version": "2.5.3", | ||
"author": "Corey Scheideman", | ||
@@ -5,0 +5,0 @@ "license": "GPL-3.0", |
77691
3.99%1061
9.49%