Location: PHPKode > scripts > Gender Guesser > Readme_CN.htm
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Gender Guesser</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<style type="text/css">
body {
    margin: 5px;
    background-color: #FFFFFF;
    color: #000000;
    font-family: Arial, ËÎÌå;
    font-size: 100%;
}

td {
    padding-right: 2ex;
    background: #FFFFFF;
    text-align: right;
    font-size: 100%;
}

a {
    color: #004080;
    text-decoration: none;
}

a:visited {
    color: #800080;
    text-decoration: none;
}

a:hover {
    color: #FF0000;
    text-decoration: underline;
}

.header_title {
    margin-bottom: 0.2em;
    text-align: center;
    font-size: x-large;
    font-weight: bold;
}

.header_subtitle {
    text-align: center;
    line-height: 2.5ex;
    font-size: small;
}

h1 {
    margin-bottom: 0.5ex;
    color: #006699;
    font-size: large;
    font-weight: bold;
}

h2 {
    margin-bottom: 0.5ex;
    color: #006699;
    font-size: medium;
    font-weight: bold;
}

pre {
    padding: 1ex;
    border: 1px solid #999999;
    background-color: #EEEEEE;
    color: #000000;
    font-family: "Courier New";
}
</style>
</head>
<body>
<div class="header_title">Gender Guesser</div>
<div class="header_subtitle">
    µ±Ç°°æ±¾: <b>0.02.0</b>, ×îºó¸üÐÂ: <b>2005Äê11ÔÂ12ÈÕ</b><br>
Wudi &lt;<a href="mailto:wudicgi&#64;yahoo&#46;de">wudicgi-at-yahoo.de</a>&gt;, <a href="http://spaces.msn.com/members/wudicgi" target="_blank">MSN Space</a>
</div>
<br>
<h1>Ãû³Æ</h1>
<p>Gender Guesser - ÐÔ±ð²Â²â</p>
<h1>¸ÅÒª</h1>
<pre>include_once 'genderguesser.lib.php';
$name = 'Íõ½Ü';
$GenderGuesser = new GenderGuesser;
$GenderGuesser->loadLexicon('charlex_gender.lex');
$tendency = $GenderGuesser->getTendency($name);
echo "$name: " . (($tendency>=0)?'ÄÐ':'Å®') . ", ÐÔ±ðÇãÏò: $tendency";</pre>
<h1>¼ò½é</h1>
<p>±¾ Class ¿ÉÒÔ¸ù¾ÝÐÕÃû²Â²âÐÔ±ð¡£Ä¿Ç°¿É´¦ÀíÁ½¸ö×Ö¡¢Èý¸ö×ÖºÍËĸö×ÖµÄÐÕÃû¡£</p>
<p>Ò»°ãÀ´Ëµ£¬ÈËÃǵÄÃû×ÖºÍÐÔ±ð¶¼ÓйØϵ¡£ÀýÈçÃû×ÖÖдøÓС°½Ü¡±¡°Ö¾¡±¡°ºê¡±µÈ×ÖµÄÒ»°ãΪÄÐÐÔ£¬´øÓС°çþ¡±¡°Å塱¡°ÁÕ¡±µÈ×ÖµÄÒ»°ãΪŮÐÔ¡£±¾ Class ¾ÍÊǸù¾ÝÕâ¸ö¹æÂÉÀ´²Â²âÐÔ±ðµÄ¡£µ±È»Ò²ÓÐһЩ±È½ÏÖÐÐÔµÄ×Ö£¬ÀýÈç¡°ÎÄ¡±¡°°²¡±¡°Ç塱µÈ£¬Í¨¹ýÕâÑùµÄ×ÖÀ´²Â²âÐÔ±ð¾Í±È½ÏÀ§ÄÑÁË¡£</p>
<h1>×¢Òâ</h1>
<p>Êý¾ÝͳһʹÓà UTF-8 ±àÂë¡£</p>
<h1>·½·¨</h1>
<h2>bool setOptions ( mixed options )</h2>
<p>ÉèÖÃÑ¡Ïî¡£options ¿ÉÒÔΪÊý×é»òÕß×Ö·û´®¡£ÈôʹÓÃ×Ö·û´®£¬¸÷Ñ¡ÏîÓÿոñ·Ö¸ô¡£</p>
<p>ÈôÒªÉèÖÃijѡÏîΪ¹Ø±Õ£¬ÔÚ´ú±í¸ÃÑ¡ÏîµÄ×Ö·ûÇ°¼Ó¼õºÅ¡°-¡±¡£¿ÉÉèÖõÄÑ¡ÏîÈçÏ£º</p>
<pre>s - name ²ÎÊý°üº¬ÐÕÊÏ¡£</pre>
<h2>bool loadLexicon ( string filename )</h2>
<p>¼ÓÔØÒ»¸ö´Êµä¡£³É¹¦·µ»Ø TURE£¬Ê§°Ü·µ»Ø FALSE¡£</p>
<h2>string getLexiconName ( )</h2>
<p>·µ»ØËù¼ÓÔشʵäµÄÃû³Æ¡£</p>
<h2>int getOffset ( string name )</h2>
<p>·µ»Ø¸ù¾ÝÐÕÃû¼ÆËã³öÀ´µÄÆ«ÒÆÁ¿¡£</p>
<p>Æ«ÒÆÁ¿ÎªÕýÊýʱ±íʾ²Â²â½á¹ûΪÄÐÐÔ£¬Îª¸ºÊýʱ±íʾ²Â²â½á¹ûΪŮÐÔ£¬ÎªÁãʱ±íʾÔÚ×ÖµäÖÐÕÒ²»µ½Ëù²éѯµÄ×Ö»ò²Â²â½á¹ûΪÖÐÐÔ¡£</p>
<h2>float getTendencyByOffset ( int offset )</h2>
<p>·µ»Ø¸ù¾ÝÆ«ÒÆÁ¿¼ÆËã³öÀ´µÄÐÔ±ðÇãÏòÖµ£¬Æ䷶ΧΪ [-1, 1]¡£ÕýÊý±íʾÄÐÐÔ£¬¸ºÊý±íʾŮÐÔ£¬Áã±íʾÖÐÐÔ¡£¾ø¶ÔÖµÔ½´ó¿ÉÄÜÐÔÔ½¸ß¡£</p>
<h2>float getTendency ( string name )</h2>
<p>·µ»Ø¸ù¾ÝÐÕÃû¼ÆËã³öÀ´µÄÐÔ±ðÇãÏòÖµ£¬²Î¿´ getTendencyByOffset() ·½·¨¡£</p>
<p>±¾·½·¨Êµ¼Ê¾ÍÊÇ getOffset() ºÍ getTendencyByOffset() µÄ×éºÏ¡£</p>
<h1>ÀúÊ·</h1>
<h2>v0.02.0 (11/12/2005)</h2>
<ul type="square">
<li> ×î³õµÄ¹«¿ª²âÊÔ°æ</li>
</ul>
<h1>×÷Õß</h1>
<p>2005, Wudi &lt;<a href="mailto:wudicgi&#64;yahoo&#46;de">wudicgi-at-yahoo.de</a>&gt;, <a href="http://spaces.msn.com/members/wudicgi" target="_blank">MSN Space</a></p>
<br>
</body>
</html>
Return current item: Gender Guesser