diproche / webinterface

1 stars 0 forks source link

Detect wrong vocabulary #6

Closed Korosensei42 closed 5 years ago

Korosensei42 commented 5 years ago

The goal is to detect words in the user input, that are either misspelled or outright not allowed in our proof engine.

The result should be a module (own ts-file) that includes a export function getVocabularyIssues(text: string): Issue[]. The type Issue should be:

export interface Issue {
  position: {
    fromIndex: number;
    toIndex: number;
  },
  message: string;
}

This type definition should go in it's own module (ts-file).

The vocabulary to check against should come from a .json-file located as a sibling-file to the created module.

The result should also contain a .test.ts-file which contains test-cases for a few normal examples and the edge-cases (like empty input, just one long word, multiple whitespaces ...).

Khazuar commented 5 years ago

I think this has been dealt with in #9