Skip to content

Commit

Permalink
Improved text component. improves #9
Browse files Browse the repository at this point in the history
  • Loading branch information
impronunciable committed Jul 23, 2016
1 parent d10c8a7 commit 387fe3f
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 11 deletions.
6 changes: 3 additions & 3 deletions nlp.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ module.exports = function (str) {
.split('\n')
.filter(function (p) { return /[0-9]+ seconds?/.test(p) })
.map(getObjects);
}
}

function getObjects(p) {
var entitiesRegex = /(^|\s|;|\.|,|:)(audio|sound|panorama|image|picture|text|videosphere|video|seconds|second|voiceover|chart|background|model)(\s|$|;|\.|,|:)/gi;
Expand Down Expand Up @@ -92,8 +92,8 @@ function getObjects(p) {
return {
type: 'text',
text: text,
position: getPosition(str, text.length * .3),
scale: getSize(str),
position: getPosition(str, 14, text.length / 30),
scale: getSize(str).map(function(el){ return el * 5; }),
rotation: getRotation(str)
}
case 'model':
Expand Down
Loading

0 comments on commit 387fe3f

Please sign in to comment.