Code Monkey home page Code Monkey logo

Comments (3)

JoshuaGrams avatar JoshuaGrams commented on August 10, 2024 1

Eh. I added the last bits of code and pushed it. We'll see how many things that breaks. It still doesn't solve the problem of giving hints for phrases, but at least it lets you drill them.

from steno-jig.

JoshuaGrams avatar JoshuaGrams commented on August 10, 2024

Yeah...I was thinking about trying to do that but it seemed like it would be more work than I felt like spending on it. Steno Jig is a weekend hack that got out of hand, so it's not very carefully structured.

The problem is that currently it splits your given answer into words, then asks for that number of words from the exercise. If some of your exercise units are phrases instead of words, then you would need to restructure the loop. It would need to loop while the answer string is non-empty, getting a single unit from the exercise and checking to see that it's a prefix of your typed answer. If it is, mark it correct and continue. If it isn't, mark some amount of the answer as an error (how much? how do you sync up again?). So matching arbitrary text turns into essentially writing a full diff algorithm? I think?

If all you need is phrasing, then a better approach would be to modify TypeJig.Exercise.prototype.nextWord, at the very bottom of type-jig.js. Instead of returning the value, stick it in a property and then chop words off until it's gone? Something like this (completely off-the-cuff and untested):

TypeJig.Exercise.prototype.nextWord = function() {
	if(this.currentUnit.length === 0) {
		var word = rotateAndShuffle(this.words);
		if(word instanceof Array) word = this.select(word);
		this.currentUnit = word.split(/\s+/)
	}
	return this.currentUnit.shift();
}

You might need a check in there for the end of the exercise, because word will probably be false or undefined instead of a string?

from steno-jig.

pete-debiase avatar pete-debiase commented on August 10, 2024

This works awesome for drilling phrases - thank you so much! I've been playing around with it this evening, and as far as I can tell, everything else still works normally. It's cool that it also still supports inputting the words in a phrase one by one (because you don't always remember to get the whole phrase off in a single stroke).

Regarding hints for phrases, it's possible that by the time steno learners reach the point of starting to drill phrases, they'll be using Steno Jig primarily to build speed rather than to learn steno theory/build steno vocab. And since the hints feature still works normally for the individual words in phrases, it might not be much of an issue at all (just my opinion).

If Steno Jig really did start out as a "weekend hack" as you put it, it's a damned impressive one. None of my weekend steno hacks have ever even graduated off the command line.

Thanks again!

from steno-jig.

Related Issues (19)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.