1
0
mirror of https://github.com/gabemart/hipku.git synced 2025-01-18 12:05:35 +00:00

Remove the useless nonWords

This commit is contained in:
lord63 2015-02-25 10:59:51 +08:00
parent 3f8749e7da
commit a78eba66f2
2 changed files with 10 additions and 18 deletions

14
dist/hipku.js vendored
View File

@ -244,9 +244,7 @@ function writeHaiku(wordArray, ipv6) {
var octet, schemaResults, schema, nonWords, haiku;
octet = 'OCTET'; // String to place in schema to show word slots
schemaResults = getSchema(ipv6, octet);
schema = schemaResults[0];
nonWords = schemaResults[1];
schema = getSchema(ipv6, octet);
/*
** Replace each instance of 'octet' in the schema with a word from
@ -327,12 +325,10 @@ function getSchema(ipv6, octet) {
var insertSpace = true;
/*
** If the next entry is a nonWord, don't add a space
** If the current entry is a nonWord, don't add a space
*/
for (var j = 0; j < nonWords.length; j++) {
if (schema[i] === nonWords[j]) {
insertSpace = false;
}
if (schema[i] in nonWords) {
insertSpace = false;
}
/*
@ -348,7 +344,7 @@ function getSchema(ipv6, octet) {
}
}
return [schema, nonWords];
return schema;
}
function capitalizeHaiku(haikuArray) {

View File

@ -244,9 +244,7 @@ function writeHaiku(wordArray, ipv6) {
var octet, schemaResults, schema, nonWords, haiku;
octet = 'OCTET'; // String to place in schema to show word slots
schemaResults = getSchema(ipv6, octet);
schema = schemaResults[0];
nonWords = schemaResults[1];
schema = getSchema(ipv6, octet);
/*
** Replace each instance of 'octet' in the schema with a word from
@ -327,12 +325,10 @@ function getSchema(ipv6, octet) {
var insertSpace = true;
/*
** If the next entry is a nonWord, don't add a space
** If the current entry is a nonWord, don't add a space
*/
for (var j = 0; j < nonWords.length; j++) {
if (schema[i] === nonWords[j]) {
insertSpace = false;
}
if (schema[i] in nonWords) {
insertSpace = false;
}
/*
@ -348,7 +344,7 @@ function getSchema(ipv6, octet) {
}
}
return [schema, nonWords];
return schema;
}
function capitalizeHaiku(haikuArray) {