Bruuuhh to find this meaning of "spin", congrtas!! Great game. Had a lot of fun trying to spin the news and make Senator Longwood a hero of his town! Very well done visuals and animations. I am so impressed by the system. How do you check for grammar and most important how do you check the meaning of the sentences?? Super duper game. Congrats again and I hope you will develop it and make a great succes with it! Hope you won't check grammar of this comment hahaha.
Viewing post in Spin the News jam comments
I can try my best to explain it.
For the Grammar: So firstly each word is assigned a part of speech based on what part of speech it generally is. Words such as to are assigned as a "preposition" despite the fact that to can technically be used as part of a verb to be. From there it is simply a matter of calculating whether each part of speech was in a valid position. Like a hinted at earlier this system wasn't perfect. I didn't account for if a word was singular or plural, which obviously changes what pronouns and state of being words should be allowed, and as I said some words like to can be different parts of speech based on context. That's why I made the grammar system very forgiving where it needs to flag three or more mistakes before they start to count against you.
For the Scoring: That was way trickier to code since context is so important. Ultimately I gave each noun or verb an either positive or negative value depending on whether it generally has positive or negative connotations: Kicked given a negative value since you normally kick things you don't like. For adjectives, pronouns, and prepositions I gave them a negative value if they negate the word they are associated with Not being the most obvious example. Once that is all decided I multiplied each noun by adjacent adjectives, each verb by adjacent adverbs, and prepositional phrases were calculated separately. Then I added up all the nouns, verbs, and prepositional phrases. This system works about 60% of the time which isn't ideal but it was the best I could figure out.
That's about all there is to it. If I were to continue developing it I would probably redo these systems from the ground up, or find a way to implement a professional grammar checker, since those are not too hard to find on the market.
This is impressive. I may be mistaken but it seems as you are a big fan of linguistics. To come up of system like that for a game haha. It's good that you could make such a "simplified" sytem for english language because of its rules. My first language would be a menace for trying to create a system for chechking correct grammar haha.