Closed flancast90 closed 3 years ago
That's neat @flancast90 , how do you want to integrate it in the speech-to-text plugin?
@BurningTreeC. I figure I'll host them on my website, and we can call just the function that handles the user input. Since we don't have an html file where we could just load it with the <script>
tags, does tiddlywiki syntax support the import
statement, or something similar? At worst case, we could just copy the content of the files to the files in our repo, so all the functions were in the same file.
You can import whole folders full of javascript files, and then "require" them with relative path names instead of tiddler titles. Create a subdirectory of the files
folder to hold the scripts
, and edit the tiddlywiki.files
file in the files
directory with the below content (add the new directories
object):
{
"tiddlers": [
{
"file": "modules/startup/speech-to-text.js",
"fields": {
"type": "application/javascript",
"title": "$:/plugins/flancast90/speech-to-text/modules/startup/speech-to-text.js",
"module-type": "startup"
}
}
],
"directories": [
{
"path": "./scripts",
"filesRegExp": "^.+\\.(c)?js",
"isTiddlerFile": false,
"isEditableFile": false,
"fields": {
"title": {
"source": "filename",
"prefix": "$:/plugins/flancast90/speech-to-text/scripts/"
},
"module-type": "library",
"type": "application/javascript"
}
}
]
}
Then, in other javascript, you can call const script = require('../relative/path/to/script')
, instead of the full "$:/plugins/flancast90/speech-to-text/scripts/filename.js" tiddler title.
Best, Joshua Fontany
Thanks, Joshua. @BurningTreeC, v1.0.0 of TW-Sounds is being released now! See https://www.github.com/flancast90/tw-sounds, and check-out the readme.md to see usage, etc.
@BurningTreeC ,
Just wanted to let you know that I have been working on TW-Sounds, and analysis of sounds and similar-sounding words to integrate with this plugin! You can see what I have done so far at https://github.com/flancast90/TW-Sounds. It is not quite ready, but I am working on the part for finding rhymes and near-rhymes without API. As you can imagine, the natural language processing and maths involved are a bit much!