Examples of WordGenerator


Examples of com.octo.captcha.component.word.wordgenerator.WordGenerator

    ImageDeformation backDef = new ImageDeformationByFilters(new ImageFilter[0]);
    ImageDeformation textDef = new ImageDeformationByFilters(new ImageFilter[0]);
    ImageDeformation postDef = new ImageDeformationByFilters(new ImageFilter[] { water });
    WordToImage word2image = new DeformedComposedWordToImage(shearedFont, back, randomPaster, backDef, textDef, postDef);

    WordGenerator dictionaryWords = new RandomWordGenerator(ERXProperties.stringForKeyWithDefault(WORD_GENERATOR, "BCDFGHJKLMNPQRSTVWXYZbcdfghjklmnpqrstvwxyz2346789"));
    addFactory(new GimpyFactory(dictionaryWords, word2image));
  }
View Full Code Here

Examples of com.octo.captcha.component.word.wordgenerator.WordGenerator

    int fontSize = 30;
    final int imageWidth = 180;
    final int imageHeight = 50;

    //word generator
    WordGenerator dictionnaryWords = new ComposeDictionaryWordGenerator(new FileDictionary("toddlist"));

    //word2image components
    TextPaster randomPaster = new DecoratedRandomTextPaster(minWordLength, maxWordLength,
        new RandomListColorGenerator(new Color[] { new Color(23, 170, 27), new Color(220, 34, 11),
            new Color(23, 67, 172) }), new TextDecorator[] {});
View Full Code Here

Examples of org.apache.cassandra.utils.KeyGenerator.WordGenerator

    public void compareBitSets()
    {
        BloomFilter bf2 = (BloomFilter) FilterFactory.getFilter(KeyGenerator.WordGenerator.WORDS / 2, FilterTestHelper.MAX_FAILURE_RATE, false);
        BloomFilter bf3 = (BloomFilter) FilterFactory.getFilter(KeyGenerator.WordGenerator.WORDS / 2, FilterTestHelper.MAX_FAILURE_RATE, true);
        int skipEven = KeyGenerator.WordGenerator.WORDS % 2 == 0 ? 0 : 2;
        WordGenerator gen1 = new KeyGenerator.WordGenerator(skipEven, 2);

        // make sure both bitsets are empty.
        compare(bf2.bitset, bf3.bitset);

        while (gen1.hasNext())
        {
            ByteBuffer key = gen1.next();
            bf2.add(key);
            bf3.add(key);
        }

        compare(bf2.bitset, bf3.bitset);
View Full Code Here

Examples of org.apache.cassandra.utils.KeyGenerator.WordGenerator

    public void compareBitSets()
    {
        BloomFilter bf2 = (BloomFilter) FilterFactory.getFilter(KeyGenerator.WordGenerator.WORDS / 2, FilterTestHelper.MAX_FAILURE_RATE, false);
        BloomFilter bf3 = (BloomFilter) FilterFactory.getFilter(KeyGenerator.WordGenerator.WORDS / 2, FilterTestHelper.MAX_FAILURE_RATE, true);
        int skipEven = KeyGenerator.WordGenerator.WORDS % 2 == 0 ? 0 : 2;
        WordGenerator gen1 = new KeyGenerator.WordGenerator(skipEven, 2);

        // make sure both bitsets are empty.
        compare(bf2.bitset, bf3.bitset);

        while (gen1.hasNext())
        {
            ByteBuffer key = gen1.next();
            bf2.add(key);
            bf3.add(key);
        }

        compare(bf2.bitset, bf3.bitset);
View Full Code Here

Examples of org.apache.cassandra.utils.KeyGenerator.WordGenerator

    public void compareBitSets()
    {
        BloomFilter bf2 = (BloomFilter) FilterFactory.getFilter(KeyGenerator.WordGenerator.WORDS / 2, FilterTestHelper.MAX_FAILURE_RATE, false);
        BloomFilter bf3 = (BloomFilter) FilterFactory.getFilter(KeyGenerator.WordGenerator.WORDS / 2, FilterTestHelper.MAX_FAILURE_RATE, true);
        int skipEven = KeyGenerator.WordGenerator.WORDS % 2 == 0 ? 0 : 2;
        WordGenerator gen1 = new KeyGenerator.WordGenerator(skipEven, 2);

        // make sure both bitsets are empty.
        compare(bf2.bitset, bf3.bitset);

        while (gen1.hasNext())
        {
            ByteBuffer key = gen1.next();
            bf2.add(key);
            bf3.add(key);
        }

        compare(bf2.bitset, bf3.bitset);
View Full Code Here

Examples of org.apache.wicket.examples.hangman.WordGenerator

   * @throws Exception
   */
  public void test_1() throws Exception
  {
    Game hangman = new Game();
    hangman.newGame(5, new WordGenerator(new String[] { "testing" }));

    Assert.assertEquals(5, hangman.getGuessesRemaining());
    Assert.assertFalse(hangman.isWon());
    Assert.assertFalse(hangman.isLost());

View Full Code Here

Examples of org.apache.wicket.examples.hangman.WordGenerator

   * @throws Exception
   */
  public void testHangmanLoseGame() throws Exception
  {
    Game hangman = new Game();
    hangman.newGame(2, new WordGenerator(new String[] { "foo" }));

    Assert.assertEquals(2, hangman.getGuessesRemaining());
    Assert.assertFalse(hangman.isWon());
    Assert.assertFalse(hangman.isLost());

View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.