public Constellation(Word word, Vector2 center) { _associatedWord = word; _centerPosition = center; _underlyingKeyboard = new SwipeKeyboard(); _swipeLine = new SwipeLine(word.OriginalWord); _selectionInterpolation = 0; OriginalConfiguration = SwipeKeyboard.WordToSwipePositions(_associatedWord.OriginalWord).ToArray(); }
public void Load() { var dict = File.ReadLines("Content/dictionary.txt").ToList(); _wordsByLength = new List <List <string> >(); for (int i = 0; i < 10; ++i) { _wordsByLength.Add(dict.Where(w => w.Length == i).ToList()); } // UNIT TEST var testWord = "princess"; Debug.Assert(ClosestWordToSwipePattern(SwipeKeyboard.WordToSwipePositions(testWord).ToArray()) == testWord); //=foreach(var sentence in ComputeSentenceVariations("the 0princess is in another 1castle")) // Console.WriteLine(sentence.Item1, sentence.Item2); }
/// <summary> /// hyphothetical - real user words ahve floaty swipe patterns /// </summary> public float WordDifference(string wordA, string wordB) => SwipePatternDifference(SwipeKeyboard.WordToSwipePositions(wordA), SwipeKeyboard.WordToSwipePositions(wordB));