public void PredictsSecondLetterForThePossibleWord()
    {
        var predictor = new DataBasedAlphabeticPredictor(Words("jack", "doe"));
        var next      = predictor.PredictionAfter("d");

        Assert.AreEqual("o", LettersToString(next));
    }
    public void PredictsSecondLetterForOneWord()
    {
        var predictor = new DataBasedAlphabeticPredictor(Words("light"));
        var next      = predictor.PredictionAfter("l");

        Assert.AreEqual("i", LettersToString(next));
    }
    public void WithNoPreviousLetterNextLayerHasWholeAlphabet()
    {
        var predictor = new DataBasedAlphabeticPredictor(Words());
        var next      = predictor.PredictionAfter("");

        Assert.AreEqual("abcdefghijklmnopqrstuvwxyz", LettersToString(next));
    }
Ejemplo n.º 4
0
    void Start()
    {
        hands = GetComponent <IHands>();
        debug = GetComponent <LiveDebug>();

        var predictor    = new DataBasedAlphabeticPredictor(EnglishWords.AsList());
        var layerCreator = new LetterBasedLayerCreator(letters, predictor);

        knobArranger = new KnobArranger(letters, knobs, layerCreator, new ConsistentAlphabeticLogicalLettersPlacer());
        knobArranger.Arrange(0f);

        var gestures = new Gestures(knobs);

        gesturesStrategy = new GesturesStrategy(gestures, knobArranger, debug);

        hands.OnHandUpdate      += OnHandUpdate;
        gesturesStrategy.OnWord += wordSuggester.Suggest;
    }
    public void PredictsSecondLettersForAllWords()
    {
        var predictor = new DataBasedAlphabeticPredictor(Words("john", "jack"));

        Assert.AreEqual("oa", LettersToString(predictor.PredictionAfter("j")));
    }
    public void SuggestedNextLettersAreLimitedToOnePerLetter()
    {
        var predictor = new DataBasedAlphabeticPredictor(Words("jackie", "jaffie", "jazzy"));

        Assert.AreEqual("a", LettersToString(predictor.PredictionAfter("j")));
    }
    public void PredictsSubsequentLettersForThePossibleWord()
    {
        var predictor = new DataBasedAlphabeticPredictor(Words("jackie", "doe"));

        Assert.AreEqual("i", LettersToString(predictor.PredictionAfter("jack")));
    }
    public void PredictsThirdLetterForThePossibleWord()
    {
        var predictor = new DataBasedAlphabeticPredictor(Words("jack", "doe"));

        Assert.AreEqual("e", LettersToString(predictor.PredictionAfter("do")));
    }