Commit 5edf82ef by Vik Paruchuri

reconfigure grammar and spell checking

parent 9cd08f36
......@@ -42,8 +42,8 @@ class FeatureExtractor(object):
self.dict_initialized = True
self._mean_spelling_errors=sum(e_set._spelling_errors)/float(len(e_set._spelling_errors))
self._spell_errors_per_character=sum(e_set._spelling_errors)/float(sum([len(t) for t in e_set._text]))
self._grammar_errors_per_character=sum(self._get_grammar_errors
(e_set._pos,e_set._text,e_set._tokens))/float(sum([len(t) for t in e_set._text]))
self._grammar_errors_per_character=1-(sum(self._get_grammar_errors
(e_set._pos,e_set._text,e_set._tokens))/float(sum([len(t) for t in e_set._text])))
ret = "ok"
else:
raise util_functions.InputError(e_set, "needs to be an essay set of the train type.")
......@@ -165,7 +165,7 @@ class FeatureExtractor(object):
all_feedback=[]
for m in xrange(0,len(e_set._text)):
individual_feedback=[]
if set_grammar_per_character[m]<self._grammar_errors_per_character:
if set_grammar_per_character[m]>self._grammar_errors_per_character:
individual_feedback.append("Potential grammatical errors.")
if set_spell_errors_per_character[m]>self._spell_errors_per_character:
individual_feedback.append("Potential spelling errors.")
......
in club to reduplicate experiment acid pelting you bequeath involve get under one s skin iv differentiate simply selfsame container , the textile marble , limestone , woods , and credit card . afterward you sustain these fabric you pauperization to consider them earlier you assign for each one of them atomic number their own container , afterwards you take in these fabric you pauperization to count them in front you commit apiece of them atomic number their possess container . later minutes , rinse off the answer turned and consider the flock again .
\ No newline at end of file
in order to replicate this experiment , we would need to know the temperature of the vinegar as well as how much vinegar to put in . both of these could vary and therefore change the result of the experiment .
\ No newline at end of file
everything in this is spelled correctly .
\ No newline at end of file
the planners envisaged that a war with japan would have three phases while the garrison of singapore defended the fortress , the fleet would make its way from home waters to singapore , sally to relieve or recapture hong kong , and blockade the japanese home islands to force japan to accept terms . the idea of invading japan was rejected as impractical , but british planners did not expect that the japanese would willingly fight a decisive naval battle against the odds . aware of the impact of a blockade on an island nation at the heart of a maritime empire , they felt that economic pressure would suffice .
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment