Skip to content

Commit

Permalink
- OOP implementation
Browse files Browse the repository at this point in the history
- New open source TTF font files
- Dictionary words for spanish and english
- New dictionary import utility
  • Loading branch information
joserodriguezvalderrama committed Jun 8, 2008
1 parent d88c521 commit 9db24aa
Show file tree
Hide file tree
Showing 10 changed files with 362,434 additions and 155 deletions.
460 changes: 305 additions & 155 deletions captcha.php

Large diffs are not rendered by default.

Binary file modified example.jpg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added fonts/Candice.ttf
Binary file not shown.
Binary file added fonts/Jura.ttf
Binary file not shown.
Binary file added fonts/VeraSansBold.ttf
Binary file not shown.
48 changes: 48 additions & 0 deletions tools/dictionary-import/importwords.php
@@ -0,0 +1,48 @@
<?php

/**
* Generate fixed-width dictionary file
*
*/


/** Word lengths */
$minLength = 5;
$maxLength = 8;





if ($argc < 3) {
die("Usage: $argv[0] infile outfile\n");
}





if (!file_exists($argv[1])) {
die("File '$argv[1]' doesn't exists\n");
}



$fp = fopen($argv[1], "r");
$fp2 = fopen($argv[2], "w");

while ($lin = fgets($fp)) {
$lin = trim(strtolower($lin));
$strlen = strlen($lin);
if ($strlen>=$minLength && $strlen<=$maxLength && preg_match("/^[a-z]+$/", $lin)) {
$lin = str_pad($lin, $maxLength);
fwrite($fp2, "$lin\n");
}
}

fclose($fp);
fclose($fp2);



?>

0 comments on commit 9db24aa

Please sign in to comment.