検索用語を入力
検索フォームを送信
my-Tool.com: ワードドメイン - ドメイン名などいろいろな目的に使用できる単語を生成して組み合わせる。 - ワードピッカー
IPアドレス
MaximaPHP
正規表現テスタ
数学
ゲーム
ネットワーク
インターネットコード
日付と時間
文字列とテキスト
ワードドメイン
コードテスタ
ビーワイズビット
ランキン
質問と答え
僕について
フォーラム
AdManner
無料広告サイト
インドネシア語
英語
ドメイン検証
ワードピッカー
ランダムワード
ドメイン組み合わせ
ワードピッカー
辞書から単語をピックアップしてある程度のランダム性を与える。
長さ
:
母音数
:
パーセント
スペル
:
英語
イギリス
イギリス(z)
アメリカン
カナディアン
特殊
ヴァリアント0
ヴァリアント1
ヴァリアント2
分類
:
単語
正式名称
大文字
略語
ハッカー
省略形
単語数
:
列数
:
このツールを利用したほとんどのお客様は以下のツールも利用しました。
Random Word
(10.0%),
IP - 国
(10.0%),
HTML Tester
(10.0%)
このツールのソースコードは以下に示す。
<?php /****************************************************************** * * WordPicker, 辞書から単語をピックアップしてある程度のランダム性を与える。 * Copyright (C) 2006, Bowo Prasetyo * * http://www.my-tool.com * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation below, * * http://www.gnu.org/licenses/gpl.html#TOC1 * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301, USA. * * このプログラムはフリーソフトウェアです。あなたはこれを、以下のURLにフリーソフトウェ * ア財団によって発行された GNU 一般公衆利用許諾契約書の定める条件の下で * 再頒布または改変することができます。 * * http://www.gnu.org/licenses/gpl.html#TOC1 * * このプログラムは有用であることを願って頒布されますが、*全くの無保証* * です。商業可能性の保証や特定の目的への適合性は、言外に示されたものも含 * め全く存在しません。詳しくはGNU 一般公衆利用許諾契約書をご覧ください。 * * あなたはこのプログラムと共に、GNU 一般公衆利用許諾契約書の複製物を一部 * 受け取ったはずです。もし受け取っていなければ、フリーソフトウェア財団ま * で請求してください(宛先は the Free Software Foundation, Inc., 59 * Temple Place, Suite 330, Boston, MA 02111-1307 USA)。 * *****************************************************************/ unset($length); if (isset($_POST['length'])) $length = trim($_POST['length']); $vowels = 30; if (isset($_POST['vowels'])) $vowels = trim($_POST['vowels']); $percent = 'yes'; if (isset($_POST['vowels'])) { if (isset($_POST['percent'])) $percent = 'yes'; else $percent = 'no'; } $spelling = array(); if (isset($_POST['spl'])) $spelling = $_POST['spl']; if(count($spelling)==0) array_push($spelling, 'english'); $class = array(); if (isset($_POST['cls'])) $class = $_POST['cls']; if(count($class)==0) array_push($class, 'words'); $count = 99; if (isset($_POST['count'])) $count = trim($_POST['count']); $columns = 3; if (isset($_POST['columns'])) $columns = trim($_POST['columns']); $randomize = 10; if (isset($_POST['randomize'])) $randomize = trim($_POST['randomize']); ?> <script type="text/javascript"> google_ad_client = "pub-6269511881695171";ngoogle_alternate_ad_url = "http://www.my-tool.com/a120_90.php"; google_ad_width = 728; google_ad_height = 15; google_ad_format = "728x15_0ads_al_s"; google_ad_channel = ""; google_color_border = "FFFFFF"; google_color_bg = "FFFFFF"; google_color_link = "A9501B"; google_color_text = "000000"; google_color_url = "008000"; </script> <script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"> </script><br /><br /> <script src="/randomizeword.js"> </script> <form name="my_tool_form" method="POST" action=""> <table border=0> <tr><td>長さ</td><td>:</td><td><input type="text" size="3" maxlength="2" name="length" value="<?php echo $length ?>"></td></tr> <tr><td>母音数</td><td>:</td><td><input type="text" size="3" maxlength="2" name="vowels" value="<?php echo $vowels ?>"> <input type="checkbox" name="percent" value="yes" <?php echo $percent=='yes'?'checked':'' ?>> パーセント</td></tr> <tr><td>スペル</td><td>:</td><td> <table><tr><td> <input type="checkbox" name="spl[]" value="english" <?php echo in_array('english',$spelling)?'checked':'' ?>> 英語</td><td> <input type="checkbox" name="spl[]" value="british" <?php echo in_array('british',$spelling)?'checked':'' ?>> イギリス</td><td> <input type="checkbox" name="spl[]" value="british_z" <?php echo in_array('british_z',$spelling)?'checked':'' ?>> イギリス(z) </td></tr><tr><td> <input type="checkbox" name="spl[]" value="american" <?php echo in_array('american',$spelling)?'checked':'' ?>> アメリカン</td><td> <input type="checkbox" name="spl[]" value="canadian" <?php echo in_array('canadian',$spelling)?'checked':'' ?>> カナディアン</td><td> <input type="checkbox" name="spl[]" value="special" <?php echo in_array('special',$spelling)?'checked':'' ?>> 特殊 </td></tr><tr><td> <input type="checkbox" name="spl[]" value="variant_0" <?php echo in_array('variant_0',$spelling)?'checked':'' ?>> ヴァリアント0</td><td> <input type="checkbox" name="spl[]" value="variant_1" <?php echo in_array('variant_1',$spelling)?'checked':'' ?>> ヴァリアント1</td><td> <input type="checkbox" name="spl[]" value="variant_2" <?php echo in_array('variant_2',$spelling)?'checked':'' ?>> ヴァリアント2 </td></tr></table> </td></tr> <tr><td>分類</td><td>:</td><td> <table><tr><td> <input type="checkbox" name="cls[]" value="words" <?php echo in_array('words',$class)?'checked':'' ?>> 単語</td><td> <input type="checkbox" name="cls[]" value="proper_names" <?php echo in_array('proper_names',$class)?'checked':'' ?>> 正式名称</td><td> <input type="checkbox" name="cls[]" value="upper" <?php echo in_array('upper',$class)?'checked':'' ?>> 大文字 </td></tr><tr><td> <input type="checkbox" name="cls[]" value="abbreviations" <?php echo in_array('abbreviations',$class)?'checked':'' ?>> 略語</td><td> <input type="checkbox" name="cls[]" value="hacker" <?php echo in_array('hacker',$class)?'checked':'' ?>> ハッカー</td><td> <input type="checkbox" name="cls[]" value="contractions" <?php echo in_array('contractions',$class)?'checked':'' ?>> 省略形 </td></tr></table> </td></tr> <tr><td colspan="3"> <table> <tr><td>単語数</td><td>:</td><td><input type="text" size="3" maxlength="3" name="count" value="<?php echo $count ?>"></td><td>列数</td><td>:</td><td><input type="text" size="3" maxlength="3" name="columns" value="<?php echo $columns ?>"></td></tr> </table> </td></tr> </table> <input type="submit" name="submit" value="単語を取り出す"> </form> <?php if ($_POST[submit]=='単語を取り出す') { $spell_cond = ''; foreach ($spelling as $value) $spell_cond .= " OR spelling = '$value'"; $spell_cond = '('.substr($spell_cond,4).')'; $class_cond = ''; foreach ($class as $value) $class_cond .= " OR class = '$value'"; $class_cond = '('.substr($class_cond,4).')'; /* Needs: SCOWL 単語リストは <a href="http://wordlist.sourceforge.net/">Kevin's Word List Page</a> から取得できる。 */ if (isset($length) && $length!='' && isset($vowels) && $vowels!='' && $percent=='yes') { $result = mysql_query("SELECT word, vowels FROM words WHERE len=$length AND vowels=".round($length*$vowels/100.0)." AND $spell_cond AND $class_cond ORDER BY random;"); } else if (isset($length) && $length!='' && isset($vowels) && $vowels!='' && $percent=='no') { $result = mysql_query("SELECT word, vowels FROM words WHERE len=$length AND vowels=$vowels AND $spell_cond AND $class_cond ORDER BY random;"); } else if (isset($vowels) && $vowels!='' && $percent=='yes') { $result = mysql_query("SELECT word, vowels FROM words WHERE vowels=ROUND(len*$vowels/100.0) AND $spell_cond AND $class_cond ORDER BY random;"); } else if (isset($vowels) && $vowels!='' && $percent=='no') { $result = mysql_query("SELECT word, vowels FROM words WHERE vowels=$vowels) AND $spell_cond AND $class_cond ORDER BY random;"); } else if (isset($length) && $length!='') { $result = mysql_query("SELECT word, vowels FROM words WHERE len=$length AND $spell_cond AND $class_cond ORDER BY random;"); } if (!$result) { die('Invalid query: '.mysql_error()); } $min = 0; $max = mysql_num_rows($result) - $count; if($max > 0) { mysql_data_seek($result, mt_rand($min, $max)); } $i = 0; while ($line = mysql_fetch_array($result, MYSQL_ASSOC)) { $i++; if ($i%$columns===0) $words .= $line['word']."\n"; else $words .= $line['word']."\t"; if ($i>=$count) break; } ?> <form name="my_tool_form_2" method="POST" action=""> <table border=0> <tr><td colspan="3"><textarea name="words" rows="20" cols="60" wrap="off"><?php echo $words ?></textarea></td></tr> <tr><td>ランダム性</td><td>:</td><td><input type="text" size="3" maxlength="2" name="randomize" value="<?php echo $randomize ?>"> パーセント</td></tr> </table> <input type="button" value="ランダムにする" onClick="loopWords(this.form.words.value, this.form.randomize.value, window.document.my_tool_form.columns.value)"> </form> <form name="my_tool_form_3" method="POST" action="/ja/word-domain/domain-combiner/"> <textarea name="result" rows="20" cols="60" wrap="off" style="border:none" readonly></textarea><br> <input type="submit" value="ドメイン組み合わせへ持っていく"> </form> <?php mysql_close($link); } ?>
'randomizeword.js'のソースコードは以下に示す。
<!-- hide /****************************************************************** * * randomizeword.js, Gives some randomization on words by percentage. * Copyright (C) 2006, Bowo Prasetyo * * http://www.my-tool.com * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation below, * * http://www.gnu.org/licenses/gpl.html#TOC1 * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301, USA. * *****************************************************************/ var rans; var consa = new Array('b', 'c', 'd', 'f', 'g', 'h', 'j', 'k', 'l', 'm', 'n', 'p', 'q', 'r', 's', 't', 'v', 'w', 'x', 'y', 'z'); var consb = new Array('l', 'r'); var vowsa = new Array('a', 'i', 'u', 'e', 'o', 'y'); function inArray(needle, haystack) { var i; var result = false; for(i=0; i<haystack.length; i++) { if (haystack[i]==needle) { result = true; break; } } return result; } function randomizeWord(word) { var i, pos, result = '', last = ''; pos = new Array(); for (i=0; i<rans; i++) pos[Math.floor(Math.random()*word.length)] = true; for (i=0; i<word.length; i++) { if (pos[i]==undefined) result += word.charAt(i); else { if ((word.charAt(i)=='h' || word.charAt(i)=='y' || word.charAt(i)=='l' || word.charAt(i)=='r') && (last==='' || inArray(last, vowsa))) result += consa[Math.floor(Math.random()*21)]; else if (word.charAt(i)=='h' || word.charAt(i)=="'") result += word.charAt(i); else if (inArray(word.charAt(i), vowsa)) result += vowsa[Math.floor(Math.random()*6)]; else if (inArray(word.charAt(i), consb)) result += consb[Math.floor(Math.random()*2)]; else result += consa[Math.floor(Math.random()*21)]; } last = word.charAt(i); } return result; } function loopWords(wrd, rand, columns) { var i, len, word, result = ''; var words = wrd.split(/[\t\r\n]+/); if (words[0]==='') words = new Array(); for (i=0; i<words.length; i++) { len = words[i].length; rans = Math.round(len*rand/100.0); if (rans>0) word = randomizeWord(words[i]); else word = words[i]; if ((i+1)%columns===0) result += word + "\n"; else result += word + "\t"; } window.document.my_tool_form_3.result.value = result; } // unhide -->
SCOWL 単語リストは
Kevin's Word List Page
から取得できる。
©2006 my-Tool.com