Examples of WordGenerator


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

      String captchaSession=captcha!=null ? captcha.getAnswer() : null;
      if(UtilMethods.isSet(captchaSession)){
       
        /*If we have a normal captcha in the session we should generate the word in the session instead of using
          a custom sound challenge*/
        WordGenerator word = new DummyWordGenerator(captchaSession.trim());
        SoundConfigurator configurator = new FreeTTSSoundConfigurator(voiceName, voicePackage, 1.0f, 100, 100);
        WordToSound word2sound = new FreeTTSWordToSound(configurator, captchaSession.length(), captchaSession.length());
        SoundCaptchaFactory factory = new SpellerSoundFactory(word, word2sound, new SpellerWordDecorator(";"));
        SoundCaptcha tCaptcha = factory.getSoundCaptcha();
        challenge = (AudioInputStream)tCaptcha.getChallenge();
View Full Code Here

Examples of com.mapr.synth.distributions.WordGenerator

import static org.junit.Assert.assertTrue;

public class WordGeneratorTest {
    @Test
    public void checkRealWords() {
        WordGenerator words = new WordGenerator("word-frequency-seed", "other-words");
        for (int i = 0; i < 20000; i++) {
            assertFalse(words.getString(i).matches("-[0-9]+"));
        }

        for (int i = 0; i < 1000; i++) {
            String w = words.getString(i + 200000);
            assertTrue(w.matches(".*-[0-9]+"));
        }
    }
View Full Code Here

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

    Integer imageWidth = new Integer(90);
    Integer imageHeight = new Integer(35);
    int fontSize = 21;

    // 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 com.octo.captcha.component.word.wordgenerator.WordGenerator

        int maxWordLength = 5;
        int fontSize = 20;
        int imageWidth = 100;
        int imageHeight = 36;

        WordGenerator dictionnaryWords = new ComposeDictionaryWordGenerator(
                new FileDictionary("toddlist"));

        // word2image components
        TextPaster randomPaster = new DecoratedRandomTextPaster(minWordLength,
                maxWordLength, new RandomListColorGenerator(new Color[]{
View Full Code Here

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

    Integer imageWidth = new Integer(90);
    Integer imageHeight = new Integer(35);
    int fontSize = 21;

    // 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),
View Full Code Here

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

            greenRange, blueRange, alphaRange));
    TextPaster textPaster = new RandomTextPaster(acceptedWordLength,
        acceptedWordLength, textColor);
    WordToImage wordToImage = new ComposedWordToImage(fontGenerator,
        backgroundGenerator, textPaster);
    WordGenerator wordGenerator = new RandomWordGenerator(acceptedChars);
    factories = new ImageCaptchaFactory[] { new GimpyFactory(wordGenerator,
        wordToImage) };
  }
View Full Code Here

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

        int maxWordLength = 5;
        int fontSize = 20;
        int imageWidth = 100;
        int imageHeight = 36;

        WordGenerator dictionnaryWords = new ComposeDictionaryWordGenerator(
                new FileDictionary("toddlist"));

        // word2image components
        TextPaster randomPaster = new DecoratedRandomTextPaster(minWordLength,
                maxWordLength, new RandomListColorGenerator(new Color[]{
View Full Code Here

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

    int fontSize = 50;
    int imageWidth = 250;
    int imageHeight = 100;

    //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 com.octo.captcha.component.word.wordgenerator.WordGenerator

                    // DeformedRandomFontGenerator(MIN_FONT_SIZE, MAX_FONT_SIZE));// to  
                    // small font  

                    // no char upper O, char lower o and numerric 0 because user cannot  
                    // answer  
                    WordGenerator words = new RandomWordGenerator(NUMERIC_CHARS  
                            + UPPER_ASCII_CHARS);  

                    for (Iterator fontIter = fontGeneratorList.iterator(); fontIter.hasNext();) {  
                        FontGenerator font = (FontGenerator) fontIter.next();  
                        for (Iterator backIter = backgroundGeneratorList.iterator(); backIter .hasNext();) {  
View Full Code Here

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

    int minWordLength = 4;
    int maxWordLength = 5;
    int fontSize = 50;
    int imageWidth = 250;
    int imageHeight = 100;
    WordGenerator dictionnaryWords = new ComposeDictionaryWordGenerator(
        new FileDictionary("toddlist"));

    // word2image components
    TextPaster randomPaster = new DecoratedRandomTextPaster(minWordLength,
        maxWordLength, new RandomListColorGenerator(new Color[] {
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.