예제 #1
0
 def test_dame_gender_females_list(self):
     g = Gender()
     f = g.females_list(corpus="es")
     self.assertTrue("Eva" in f)
     self.assertEqual(len(f), 24818)
     f2 = g.females_list(corpus="uk")
     self.assertTrue("Ana" in f2)
     self.assertEqual(len(f2), 19060)
     f3 = g.females_list(corpus="us")
     self.assertTrue("Ana" in f3)
     self.assertEqual(len(f3), 58013)
     f4 = g.females_list(corpus="uy")
     self.assertTrue("Ana" in f4)
     self.assertEqual(len(f4), 13597)
예제 #2
0
# 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 GNU Emacs; see the file COPYING.  If not, write to
# the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
# Boston, MA 02110-1301 USA,
from app.dame_gender import Gender

g = Gender()

# LETTER A
print("---------------------------------------------------------------")
females = 0
for i in g.females_list():
    if (g.features_int(i)["a"] >= 1):
        females = females + 1
#print("Females with last letter a: " + str(females))
print("Females with letter/s a: %s " % (females / len(g.females_list())))

males = 0
for i in g.males_list():
    if (g.features_int(i)["a"] >= 1):
        males = males + 1
print("Males with letter/s a: %s " % (males / len(g.males_list())))

# LAST LETTER A
print("---------------------------------------------------------------")
females = 0
for i in g.females_list():
예제 #3
0
 def test_dame_gender_females_list_method_returns_correct_result(self):
     g = Gender()
     f = g.females_list()
     self.assertTrue("Eva" in f)