The next revolution in typing on laptops was released on the first of April, 2014 by SwiftKey. However, I want to be the first person to write a swiping nano clone, but, as I can't find a good swipe-text to real-text library, and I can't wait for them, I'm asking here.
Task
Write a program that takes in swipe-text and outputs the real-text equivalent. Example:
Input: hgrerhjklo
Output: hello
When the user does:
Other examples:
Input: wertyuioiuytrtjklkjhgfd
Output: world
Input: poiuytrtyuioiugrewsasdfgbhnmkijnbg
Output: programming
Input: poiuygfdzxcvhjklkjhgres
Output: puzzles
Input: cvhjioiugfde
Output: code
Input: ghiolkjhgf
Output: golf
Rules
- The program will take one swiped 'word' in on stdin or argv
- The first and last letter of the swiped input will equate to the first and last letter of the real word
- You can assume the user will make reasonably straight lines, but you can use the sample data to verify this (I made the sample data, and I will make the final test data)
- For ambiguous input, you can make select either output, but I will try to eradicate all ambiguousness from the test data
- This word will be in this word list (but swiped). The word list will be in the current directory, and can be read (newline separated, will be named
wordlist
, no extension). - The swipe will only contain lowercase alphabetic characters
- The swipe may contain duplicated characters, if the user pauses on a key
- The program must output on stdout (case does not matter)
- The program must return
0
as the return code - You must provide the run command, compile command (if needed), name and which input path to use
- Standard loopholes apply (they might not help, though)
- No non-builtin libraries allowed
- Deterministic, non golfed / obfuscated solutions preferred
- No file writing, networking, etc.
- Your code must run in one second or less (your code is run once per word)
- The scoring runs are run on a Intel i7 Haswell processor, with 4 virtual code (2 real ones), so you can use threads if you have to
- Maximum code length of 5000 bytes
- The language you use must have a free (non trial) version available for Linux (Arch Linux, if that matters)
Winning Criterion
- The winner is the most accurate solution (scored by the control program, using the provided test list)
- Popularity is the tie breaker
- The scoring table will be updated every few days
- Time-outs and crashes count as fails
- This challenge will run for two weeks or more, depending on popularity
- The final scoring will use a different, randomly selected list of words (same length, from same word list)
Other
- You can use the control program to test your program
- If you are impatient, and want your program updated / added quickly, start an issue or pull request at https://github.com/matsjoyce/codegolf-swipe-type/blob/master
- Entries are maintained at https://github.com/matsjoyce/codegolf-swipe-type/blob/master/entries
- Logs of each program run are maintained at https://github.com/matsjoyce/codegolf-swipe-type/blob/master/logs
- Main log at https://github.com/matsjoyce/codegolf-swipe-type/blob/master/log.log
- The position of each key will be provided as a csv file in the current directory called
keypos.csv
, with the x and y values given as relative toQ
(see https://github.com/matsjoyce/codegolf-swipe-type/blob/master/keypos.csv) - Each key is 1.5 x 1.5 cm (same unit as in keypos.csv)
Current Score Boards
Three Pass Optimizer:Errors: 0/250 Fails: 7/250 Passes: 243/250 Timeouts: 0/250
Corner Sim: Errors: 0/250 Fails: 9/250 Passes: 241/250 Timeouts: 0/250
Discrete Fréchet Distance:Errors: 0/250 Fails: 17/250 Passes: 233/250 Timeouts: 0/250
Turnaround: Errors: 0/250 Fails: 18/250 Passes: 232/250 Timeouts: 0/250
Direction Checker: Errors: 0/250 Fails: 19/250 Passes: 231/250 Timeouts: 0/250
Regex Solver: Errors: 0/250 Fails: 63/250 Passes: 187/250 Timeouts: 0/250
Corner Sim: Errors: 0/250 Fails: 10/250 Passes: 240/250 Timeouts: 0/250
Three Pass Optimizer:Errors: 2/250 Fails: 14/250 Passes: 234/250 Timeouts: 0/250
Turnaround: Errors: 0/250 Fails: 16/250 Passes: 234/250 Timeouts: 0/250
Direction Checker: Errors: 0/250 Fails: 17/250 Passes: 233/250 Timeouts: 0/250
Discrete Fréchet Distance:Errors: 0/250 Fails: 18/250 Passes: 232/250 Timeouts: 0/250
Regex Solver: Errors: 0/250 Fails: 67/250 Passes: 183/250 Timeouts: 0/250
Final Run
Corner Sim: Errors: 0/250 Fails: 14/250 Passes: 236/250 Timeouts: 0/250
Three Pass Optimizer:Errors: 0/250 Fails: 18/250 Passes: 232/250 Timeouts: 0/250
Direction Checker: Errors: 0/250 Fails: 20/250 Passes: 230/250 Timeouts: 0/250
Turnaround: Errors: 0/250 Fails: 23/250 Passes: 227/250 Timeouts: 0/250
Discrete Fréchet Distance:Errors: 0/250 Fails: 30/250 Passes: 220/250 Timeouts: 0/250
Regex Solver: Errors: 0/250 Fails: 55/250 Passes: 195/250 Timeouts: 0/250
Well done to everybody and hgfdsasdertyuiopoiuy swertyuiopoijnhg!
l
, which is not doubled. \$\endgroup\$