Skip to content

Instantly share code, notes, and snippets.

@valeIT
Created November 25, 2018 15:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save valeIT/a8724dc4cea3c665bddf22462c28c6f6 to your computer and use it in GitHub Desktop.
Save valeIT/a8724dc4cea3c665bddf22462c28c6f6 to your computer and use it in GitHub Desktop.
my session is 200 words long. Let's start and see how close I get without looking at the word count. This is also goint go be on a sinle line to check if WriteRise word miscalculation is only based on line wraps or if there is actually something wrong. I used to count words as characters, but . Oh I also can't delete anything I'm writing since I'm counting words and I decided not to include a deleted words count for now (more explanation on that later on). I dediced in the very beginning to track characters instead of words because it was easier and I needed to make an MVP to see if tracking words across all applications and categorize them was viable. Later on I changed from counting characters to counting words, which is the only metric we really care about. To count words you can't simply parse a file and get the word count, which is what most writing applications do (and which is failry easy to do) we need to actually detect keypresses, anonymize them and strip them of all information and only parse count them as valid whenever we detect word. But how we detect a word is the next question? Simple! We just count every space! Oh so if we type space space space we typed 3 words! mm not so easy. Than we count a space followed by a character. Great! so space + (CMD+A) which is select all counts as a word! Again, not really... I just peaked at the word count and it says 240, but I noticed it skipped a few words, expecially after the 3 dots, so the current algorithm is not perfect yet. We are going to stop at 300 words for now and check how many words were instead. After we calculate the difference. The objective of the next few weeks is to change reduce this number from probably a 2 digits number to a one digit number. I don't think I can't get it less than 10%, but we are going to aim to 9% anyway. My estimate is that at the moment the error is around 30%, which is terrible, but expected. The algorithm is not terrible, but it's not really great wither. There is a lot of room for improvement. Ops, I kept writing and skipped the 300 words limit. I'm going to stop now since I'm close to 350 Anyway. I also erroneously deleted a few words when I wasn't wupposed to delete any so the count might be screwed for that as well. Ok we finally reached 400 words. Let's see how many we have in reality. Writerise: 394 words.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment