syncmind 0.1.1 → 0.1.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/lib/syncmind.rb +341 -948
  3. data/lib/syncmind/version.rb +1 -1
  4. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 81f98a8d755eb2900501945e330638299612a64bdc92c7bcb9bbb935a7fbeddf
4
- data.tar.gz: c3a7f76fed85fffb9eba0f23ee484bfbec21fa1d78e1cb6e8850f4460fb63521
3
+ metadata.gz: aae019966851775b12025ae353a4c195ab0aa457dd4587b98edb84633bbbbd53
4
+ data.tar.gz: 6009ce584bc34f2908c52a19b6a2978a827c17328d83260cc13756a59a139923
5
5
  SHA512:
6
- metadata.gz: 4ff258f5d763357dec8106187de29e1d94decd6c2a9ee9fe75403c074068a7dde548a08bf532462231e1bf02cbbeea18cde11674cd09d6e1d36f8dfa41dac420
7
- data.tar.gz: 40a806d47fe32a5365cb409cc56090519576920cf9f02f62d5f0a6652ba664a8477c12df5b26e67dd9467813055fe76b6244dedb56aab992e01b0bde0bfe351a
6
+ metadata.gz: 27a016bab7e6f763f7e46f30f32ff08fc80ae5e084342bac87cc1833d082be2c98af566b5e863d774722678bae2a5f628671a025e54f773a251bbd34613a3a0f
7
+ data.tar.gz: 7e845f218f974adf725471541f86f4c3a77c1aca7949a7f0fdc475577bb8d8bbd33bcb341b717315c4607ca18e4ddd1ac07c794fdd7fea263d6a44c66c3a5218
data/lib/syncmind.rb CHANGED
@@ -1323,966 +1323,359 @@ module Syncmind
1323
1323
 
1324
1324
  class OperateChatBot
1325
1325
 
1326
- def self.analyze_script
1326
+ def self.analyze_script
1327
+
1327
1328
  loop do
1328
1329
  require "naive_bayes"
1329
1330
 
1330
- # Checks if what you reference is a pet.
1331
- def self.check_pets
1332
- bot_name = File.read("bot_identity/bot_name.txt").strip
1333
- your_name = File.read("your_identity/your_identity.txt").strip
1334
-
1335
- a = NaiveBayes.new(:pets, :notpets)
1336
-
1337
- # Are Pets
1338
- a.train(:pets, "dog", "word")
1339
- a.train(:pets, "cat", "word")
1340
- a.train(:pets, "rat", "word")
1341
- a.train(:pets, "gerbil", "word")
1342
- a.train(:pets, "hamster", "word")
1343
- a.train(:pets, "pig", "word")
1344
- a.train(:pets, "monkey", "word")
1345
- a.train(:pets, "dog.", "word")
1346
- a.train(:pets, "cat.", "word")
1347
- a.train(:pets, "rat.", "word")
1348
- a.train(:pets, "gerbil.", "word")
1349
- a.train(:pets,"hamster.", "word")
1350
- a.train(:pets, "pig.", "word")
1351
- a.train(:pets, "monkey.", "word")
1352
- a.train(:pets, "dog,", "word")
1353
- a.train(:pets, "cat,", "word")
1354
- a.train(:pets, "rat,", "word")
1355
- a.train(:pets, "gerbil,", "word")
1356
- a.train(:pets,"hamster,", "word")
1357
- a.train(:pets, "pig,", "word")
1358
- a.train(:pets, "monkey,", "word")
1359
- a.train(:pets, "dog;", "word")
1360
- a.train(:pets, "cat;", "word")
1361
- a.train(:pets, "rat;", "word")
1362
- a.train(:pets, "gerbil;", "word")
1363
- a.train(:pets,"hamster;", "word")
1364
- a.train(:pets, "pig;", "word")
1365
- a.train(:pets, "monkey;", "word")
1366
- a.train(:pets, "dog:", "word")
1367
- a.train(:pets, "cat:", "word")
1368
- a.train(:pets, "rat:", "word")
1369
- a.train(:pets, "gerbil:", "word")
1370
- a.train(:pets,"hamster:", "word")
1371
- a.train(:pets, "pig:", "word")
1372
- a.train(:pets, "monkey:", "word")
1373
- a.train(:pets, "dog?", "word")
1374
- a.train(:pets, "cat?", "word")
1375
- a.train(:pets, "rat?", "word")
1376
- a.train(:pets, "gerbil?", "word")
1377
- a.train(:pets,"hamster?", "word")
1378
- a.train(:pets, "pig?", "word")
1379
- a.train(:pets, "monkey?", "word")
1380
-
1381
- # Not Pets
1382
- a.train(:notpets, "horse", "word")
1383
- a.train(:notpets, "donkey", "word")
1384
- a.train(:notpets, "cow", "word")
1385
- a.train(:netpets, "python", "word")
1386
- a.train(:notpets, "wildcat", "word")
1387
- a.train(:notpets, "elephant", "word")
1388
- a.train(:notpets, "tiger", "word")
1389
- a.train(:notpets, "lion", "word")
1390
- a.train(:notpets, "hyena", "word")
1391
- a.train(:notpets, "bandicoot", "word")
1392
- a.train(:notpets, "panda", "word")
1393
- a.train(:notpets, "horse.", "word")
1394
- a.train(:notpets, "donkey.", "word")
1395
- a.train(:notpets, "cow.", "word")
1396
- a.train(:netpets, "python.", "word")
1397
- a.train(:notpets, "wildcat.", "word")
1398
- a.train(:notpets, "elephant.", "word")
1399
- a.train(:notpets, "tiger.", "word")
1400
- a.train(:notpets, "lion.", "word")
1401
- a.train(:notpets, "hyena.", "word")
1402
- a.train(:notpets, "bandicoot.", "word")
1403
- a.train(:notpets, "panda.", "word")
1404
- a.train(:notpets, "horse;", "word")
1405
- a.train(:notpets, "donkey;", "word")
1406
- a.train(:notpets, "cow;", "word")
1407
- a.train(:netpets, "python;", "word")
1408
- a.train(:notpets, "wildcat;", "word")
1409
- a.train(:notpets, "elephant;", "word")
1410
- a.train(:notpets, "tiger;", "word")
1411
- a.train(:notpets, "lion;", "word")
1412
- a.train(:notpets, "hyena;", "word")
1413
- a.train(:notpets, "bandicoot;", "word")
1414
- a.train(:notpets, "panda;", "word")
1415
- a.train(:notpets, "horse:", "word")
1416
- a.train(:notpets, "donkey:", "word")
1417
- a.train(:notpets, "cow:", "word")
1418
- a.train(:netpets, "python:", "word")
1419
- a.train(:notpets, "wildcat:", "word")
1420
- a.train(:notpets, "elephant:", "word")
1421
- a.train(:notpets, "tiger:", "word")
1422
- a.train(:notpets, "lion:", "word")
1423
- a.train(:notpets, "hyena:", "word")
1424
- a.train(:notpets, "bandicoot:", "word")
1425
- a.train(:notpets, "panda:", "word")
1426
- a.train(:notpets, "horse:", "word")
1427
- a.train(:notpets, "donkey?", "word")
1428
- a.train(:notpets, "cow?", "word")
1429
- a.train(:netpets, "python?", "word")
1430
- a.train(:notpets, "wildcat?", "word")
1431
- a.train(:notpets, "elephant?", "word")
1432
- a.train(:notpets, "tiger?", "word")
1433
- a.train(:notpets, "lion?", "word")
1434
- a.train(:notpets, "hyena?", "word")
1435
- a.train(:notpets, "bandicoot?", "word")
1436
- a.train(:notpets, "panda?", "word")
1437
-
1438
- # Chatbot process for asking about pets.
1439
- print "#{bot_name}: Do you have any pets??\n#{your_name}: "
1440
- b = gets.chomp.split(' ')
1441
-
1442
- # Classify b and convert to string.
1443
- a_class = a.classify(*b)
1444
- result = a_class[0]
1445
- decision = result.to_s
1446
-
1447
- if decision == "pets"
1448
- puts "#{bot_name}: Do you love your pet?"
1449
- else
1450
- puts "#{bot_name}: Why do you have that for a pet?"
1451
- end
1452
- end
1331
+ # Personality statistics and files.
1332
+ iteration = File.read("data/iteration.txt") # Controls the sleep time between personality details and input.
1333
+ script = File.readlines("data/script.txt") # The script file the mindfile reads from.
1334
+ personality_details = script.sample # Personality detail read from a script.
1453
1335
 
1454
- # Checks if what you reference is a hobby.
1455
- def self.check_hobbies
1456
- bot_name = File.read("bot_identity/bot_name.txt").strip
1457
- your_name = File.read("your_identity/your_identity.txt").strip
1458
-
1459
- a = NaiveBayes.new(:hobbies, :nothobbies)
1460
-
1461
- # Are Hobbies
1462
- a.train(:hobbies, "sing", "word")
1463
- a.train(:hobbies, "illustrate", "word")
1464
- a.train(:hobbies, "draw", "word")
1465
- a.train(:hobbies, "write", "word")
1466
- a.train(:hobbies, "widdle", "word")
1467
- a.train(:hobbies, "dance", "word")
1468
- a.train(:hobbies, "clog", "word")
1469
- a.train(:hobbies, "weave", "word")
1470
- a.train(:hobbies, "crochet", "word")
1471
- a.train(:hobbies, "knit", "word")
1472
- a.train(:hobbies, "swim", "word")
1473
- a.train(:hobbies, "BDSM", "word")
1474
- a.train(:hobbies, "game", "word")
1475
- a.train(:hobbies, "JRPG", "word")
1476
- a.train(:hobbies, "MMORPG", "word")
1477
- a.train(:hobbies, "FPS", "word")
1478
- a.train(:hobbies, "SIM", "word")
1479
- a.train(:hobbies, "metroidvania", "word")
1480
- a.train(:hobbies, "football", "word")
1481
- a.train(:hobbies, "baseball", "word")
1482
- a.train(:hobbies, "soccer", "word")
1483
- a.train(:hobbies, "volleyball", "word")
1484
- a.train(:hobbies, "skateboard", "word")
1485
- a.train(:hobbies, "bike", "word")
1486
- a.train(:hobbies, "skate", "word")
1487
- a.train(:hobbies, "sing.", "word")
1488
- a.train(:hobbies, "illustrate.", "word")
1489
- a.train(:hobbies, "draw.", "word")
1490
- a.train(:hobbies, "write.", "word")
1491
- a.train(:hobbies, "widdle.", "word")
1492
- a.train(:hobbies, "dance.", "word")
1493
- a.train(:hobbies, "clog.", "word")
1494
- a.train(:hobbies, "weave.", "word")
1495
- a.train(:hobbies, "crochet.", "word")
1496
- a.train(:hobbies, "knit.", "word")
1497
- a.train(:hobbies, "swim.", "word")
1498
- a.train(:hobbies, "BDSM.", "word")
1499
- a.train(:hobbies, "game.", "word")
1500
- a.train(:hobbies, "JRPG.", "word")
1501
- a.train(:hobbies, "MMORPG.", "word")
1502
- a.train(:hobbies, "FPS.", "word")
1503
- a.train(:hobbies, "SIM.", "word")
1504
- a.train(:hobbies, "metroidvania.", "word")
1505
- a.train(:hobbies, "football.", "word")
1506
- a.train(:hobbies, "baseball.", "word")
1507
- a.train(:hobbies, "soccer.", "word")
1508
- a.train(:hobbies, "volleyball.", "word")
1509
- a.train(:hobbies, "skateboard.", "word")
1510
- a.train(:hobbies, "bike.", "word")
1511
- a.train(:hobbies, "skate.", "word")
1512
- a.train(:hobbies, "illustrate;", "word")
1513
- a.train(:hobbies, "draw;", "word")
1514
- a.train(:hobbies, "write;", "word")
1515
- a.train(:hobbies, "widdle;", "word")
1516
- a.train(:hobbies, "dance;", "word")
1517
- a.train(:hobbies, "clog;", "word")
1518
- a.train(:hobbies, "weave;", "word")
1519
- a.train(:hobbies, "crochet;", "word")
1520
- a.train(:hobbies, "knit;", "word")
1521
- a.train(:hobbies, "swim;", "word")
1522
- a.train(:hobbies, "BDSM;", "word")
1523
- a.train(:hobbies, "game;", "word")
1524
- a.train(:hobbies, "JRPG;", "word")
1525
- a.train(:hobbies, "MMORPG;", "word")
1526
- a.train(:hobbies, "FPS;", "word")
1527
- a.train(:hobbies, "SIM;", "word")
1528
- a.train(:hobbies, "metroidvania;", "word")
1529
- a.train(:hobbies, "football;", "word")
1530
- a.train(:hobbies, "baseball;", "word")
1531
- a.train(:hobbies, "soccer;", "word")
1532
- a.train(:hobbies, "volleyball;", "word")
1533
- a.train(:hobbies, "skateboard;", "word")
1534
- a.train(:hobbies, "bike;", "word")
1535
- a.train(:hobbies, "skate;", "word")
1536
- a.train(:hobbies, "illustrate:", "word")
1537
- a.train(:hobbies, "draw:", "word")
1538
- a.train(:hobbies, "write:", "word")
1539
- a.train(:hobbies, "widdle:", "word")
1540
- a.train(:hobbies, "dance:", "word")
1541
- a.train(:hobbies, "clog:", "word")
1542
- a.train(:hobbies, "weave:", "word")
1543
- a.train(:hobbies, "crochet:", "word")
1544
- a.train(:hobbies, "knit:", "word")
1545
- a.train(:hobbies, "swim:", "word")
1546
- a.train(:hobbies, "BDSM:", "word")
1547
- a.train(:hobbies, "game:", "word")
1548
- a.train(:hobbies, "JRPG:", "word")
1549
- a.train(:hobbies, "MMORPG:", "word")
1550
- a.train(:hobbies, "FPS:", "word")
1551
- a.train(:hobbies, "SIM:", "word")
1552
- a.train(:hobbies, "metroidvania:", "word")
1553
- a.train(:hobbies, "football:", "word")
1554
- a.train(:hobbies, "baseball:", "word")
1555
- a.train(:hobbies, "soccer:", "word")
1556
- a.train(:hobbies, "volleyball:", "word")
1557
- a.train(:hobbies, "skateboard:", "word")
1558
- a.train(:hobbies, "bike:", "word")
1559
- a.train(:hobbies, "skate:", "word")
1560
- a.train(:hobbies, "illustrate?", "word")
1561
- a.train(:hobbies, "draw?", "word")
1562
- a.train(:hobbies, "write?", "word")
1563
- a.train(:hobbies, "widdle?", "word")
1564
- a.train(:hobbies, "dance?", "word")
1565
- a.train(:hobbies, "clog?", "word")
1566
- a.train(:hobbies, "weave?", "word")
1567
- a.train(:hobbies, "crochet?", "word")
1568
- a.train(:hobbies, "knit?", "word")
1569
- a.train(:hobbies, "swim?", "word")
1570
- a.train(:hobbies, "BDSM?", "word")
1571
- a.train(:hobbies, "game?", "word")
1572
- a.train(:hobbies, "JRPG?", "word")
1573
- a.train(:hobbies, "MMORPG?", "word")
1574
- a.train(:hobbies, "FPS?", "word")
1575
- a.train(:hobbies, "SIM?", "word")
1576
- a.train(:hobbies, "metroidvania?", "word")
1577
- a.train(:hobbies, "football?", "word")
1578
- a.train(:hobbies, "baseball?", "word")
1579
- a.train(:hobbies, "soccer?", "word")
1580
- a.train(:hobbies, "volleyball?", "word")
1581
- a.train(:hobbies, "skateboard?", "word")
1582
- a.train(:hobbies, "bike?", "word")
1583
- a.train(:hobbies, "skate?", "word")
1584
- a.train(:hobbies, "sung", "word")
1585
- a.train(:hobbies, "illustrated", "word")
1586
- a.train(:hobbies, "drew", "word")
1587
- a.train(:hobbies, "wrote", "word")
1588
- a.train(:hobbies, "widdled", "word")
1589
- a.train(:hobbies, "danced", "word")
1590
- a.train(:hobbies, "clogged", "word")
1591
- a.train(:hobbies, "wove", "word")
1592
- a.train(:hobbies, "crocheted", "word")
1593
- a.train(:hobbies, "knitted", "word")
1594
- a.train(:hobbies, "skateboarded", "word")
1595
- a.train(:hobbies, "biked", "word")
1596
- a.train(:hobbies, "skated", "word")
1597
- a.train(:hobbies, "singing", "word")
1598
- a.train(:hobbies, "illustrating", "word")
1599
- a.train(:hobbies, "drawing", "word")
1600
- a.train(:hobbies, "writing", "word")
1601
- a.train(:hobbies, "widdling", "word")
1602
- a.train(:hobbies, "dancing", "word")
1603
- a.train(:hobbies, "clogging", "word")
1604
- a.train(:hobbies, "weaving", "word")
1605
- a.train(:hobbies, "crocheting", "word")
1606
- a.train(:hobbies, "knitting", "word")
1607
- a.train(:hobbies, "skateboarding", "word")
1608
- a.train(:hobbies, "biking", "word")
1609
- a.train(:hobbies, "skating", "word")
1610
- a.train(:hobbies, "sung.", "word")
1611
- a.train(:hobbies, "illustrated.", "word")
1612
- a.train(:hobbies, "drew.", "word")
1613
- a.train(:hobbies, "wrote.", "word")
1614
- a.train(:hobbies, "widdled.", "word")
1615
- a.train(:hobbies, "danced.", "word")
1616
- a.train(:hobbies, "clogged.", "word")
1617
- a.train(:hobbies, "wove.", "word")
1618
- a.train(:hobbies, "crocheted.", "word")
1619
- a.train(:hobbies, "knitted.", "word")
1620
- a.train(:hobbies, "skateboarded.", "word")
1621
- a.train(:hobbies, "biked.", "word")
1622
- a.train(:hobbies, "skated.", "word")
1623
- a.train(:hobbies, "singing.", "word")
1624
- a.train(:hobbies, "illustrating.", "word")
1625
- a.train(:hobbies, "drawing.", "word")
1626
- a.train(:hobbies, "writing.", "word")
1627
- a.train(:hobbies, "widdling.", "word")
1628
- a.train(:hobbies, "dancing.", "word")
1629
- a.train(:hobbies, "clogging.", "word")
1630
- a.train(:hobbies, "weaving.", "word")
1631
- a.train(:hobbies, "crocheting.", "word")
1632
- a.train(:hobbies, "knitting.", "word")
1633
- a.train(:hobbies, "skateboarding.", "word")
1634
- a.train(:hobbies, "biking.", "word")
1635
- a.train(:hobbies, "skating.", "word")
1636
- a.train(:hobbies, "sung;", "word")
1637
- a.train(:hobbies, "illustrated;", "word")
1638
- a.train(:hobbies, "drew;", "word")
1639
- a.train(:hobbies, "wrote;", "word")
1640
- a.train(:hobbies, "widdled;", "word")
1641
- a.train(:hobbies, "danced;", "word")
1642
- a.train(:hobbies, "clogged;", "word")
1643
- a.train(:hobbies, "wove;", "word")
1644
- a.train(:hobbies, "crocheted;", "word")
1645
- a.train(:hobbies, "knitted;", "word")
1646
- a.train(:hobbies, "skateboarded;", "word")
1647
- a.train(:hobbies, "biked;", "word")
1648
- a.train(:hobbies, "skated;", "word")
1649
- a.train(:hobbies, "singing;", "word")
1650
- a.train(:hobbies, "illustrating;", "word")
1651
- a.train(:hobbies, "drawing;", "word")
1652
- a.train(:hobbies, "writing;", "word")
1653
- a.train(:hobbies, "widdling;", "word")
1654
- a.train(:hobbies, "dancing;", "word")
1655
- a.train(:hobbies, "clogging;", "word")
1656
- a.train(:hobbies, "weaving;", "word")
1657
- a.train(:hobbies, "crocheting;", "word")
1658
- a.train(:hobbies, "knitting;", "word")
1659
- a.train(:hobbies, "skateboarding;", "word")
1660
- a.train(:hobbies, "biking;", "word")
1661
- a.train(:hobbies, "skating;", "word")
1662
- a.train(:hobbies, "sung:", "word")
1663
- a.train(:hobbies, "illustrated:", "word")
1664
- a.train(:hobbies, "drew:", "word")
1665
- a.train(:hobbies, "wrote:", "word")
1666
- a.train(:hobbies, "widdled:", "word")
1667
- a.train(:hobbies, "danced:", "word")
1668
- a.train(:hobbies, "clogged:", "word")
1669
- a.train(:hobbies, "wove:", "word")
1670
- a.train(:hobbies, "crocheted:", "word")
1671
- a.train(:hobbies, "knitted:", "word")
1672
- a.train(:hobbies, "skateboarded:", "word")
1673
- a.train(:hobbies, "biked:", "word")
1674
- a.train(:hobbies, "skated:", "word")
1675
- a.train(:hobbies, "singing:", "word")
1676
- a.train(:hobbies, "illustrating:", "word")
1677
- a.train(:hobbies, "drawing:", "word")
1678
- a.train(:hobbies, "writing:", "word")
1679
- a.train(:hobbies, "widdling:", "word")
1680
- a.train(:hobbies, "dancing:", "word")
1681
- a.train(:hobbies, "clogging:", "word")
1682
- a.train(:hobbies, "weaving:", "word")
1683
- a.train(:hobbies, "crocheting:", "word")
1684
- a.train(:hobbies, "knitting:", "word")
1685
- a.train(:hobbies, "skateboarding:", "word")
1686
- a.train(:hobbies, "biking:", "word")
1687
- a.train(:hobbies, "skating:", "word")
1688
- a.train(:hobbies, "sung?", "word")
1689
- a.train(:hobbies, "illustrated?", "word")
1690
- a.train(:hobbies, "drew?", "word")
1691
- a.train(:hobbies, "wrote?", "word")
1692
- a.train(:hobbies, "widdled?", "word")
1693
- a.train(:hobbies, "danced?", "word")
1694
- a.train(:hobbies, "clogged?", "word")
1695
- a.train(:hobbies, "wove?", "word")
1696
- a.train(:hobbies, "crocheted?", "word")
1697
- a.train(:hobbies, "knitted?", "word")
1698
- a.train(:hobbies, "skateboarded?", "word")
1699
- a.train(:hobbies, "biked?", "word")
1700
- a.train(:hobbies, "skated?", "word")
1701
- a.train(:hobbies, "singing?", "word")
1702
- a.train(:hobbies, "illustrating?", "word")
1703
- a.train(:hobbies, "drawing?", "word")
1704
- a.train(:hobbies, "writing?", "word")
1705
- a.train(:hobbies, "widdling?", "word")
1706
- a.train(:hobbies, "dancing?", "word")
1707
- a.train(:hobbies, "clogging?", "word")
1708
- a.train(:hobbies, "weaving?", "word")
1709
- a.train(:hobbies, "crocheting?", "word")
1710
- a.train(:hobbies, "knitting?", "word")
1711
- a.train(:hobbies, "skateboarding?", "word")
1712
- a.train(:hobbies, "biking?", "word")
1713
- a.train(:hobbies, "skating?", "word")
1714
-
1715
- # Not Hobbies
1716
- a.train(:nothobbies, "nurse", "word")
1717
- a.train(:nothobbies, "officer", "word")
1718
- a.train(:nothobbies, "fireman", "word")
1719
- a.train(:nothobbies, "cashier", "word")
1720
- a.train(:nothobbies, "stocker", "word")
1721
- a.train(:nothobbies, "barber", "word")
1722
- a.train(:nothobbies, "stylist", "word")
1723
- a.train(:nothobbies, "clerk", "word")
1724
- a.train(:nothobbies, "butcher", "word")
1725
- a.train(:nothobbies, "reporter", "word")
1726
- a.train(:nothobbies, "manager", "word")
1727
- a.train(:nothobbies, "crane", "word")
1728
- a.train(:nothobbies, "lawyer", "word")
1729
- a.train(:nothobbies, "cameraman", "word")
1730
- a.train(:nothobbies, "engineer", "word")
1731
- a.train(:nothobbies, "pilot", "word")
1732
- a.train(:nothobbies, "nursing.", "word")
1733
- a.train(:nothobbies, "officer.", "word")
1734
- a.train(:nothobbies, "fireman.", "word")
1735
- a.train(:nothobbies, "cashier.", "word")
1736
- a.train(:nothobbies, "stocker.", "word")
1737
- a.train(:nothobbies, "barber.", "word")
1738
- a.train(:nothobbies, "stylist.", "word")
1739
- a.train(:nothobbies, "clerk.", "word")
1740
- a.train(:nothobbies, "butcher.", "word")
1741
- a.train(:nothobbies, "reporter.", "word")
1742
- a.train(:nothobbies, "manager.", "word")
1743
- a.train(:nothobbies, "crane.", "word")
1744
- a.train(:nothobbies, "lawyer.", "word")
1745
- a.train(:nothobbies, "cameraman.", "word")
1746
- a.train(:nothobbies, "engineer.", "word")
1747
- a.train(:nothobbies, "pilot.", "word")
1748
- a.train(:nothobbies, "nursing;", "word")
1749
- a.train(:nothobbies, "officer;", "word")
1750
- a.train(:nothobbies, "fireman;", "word")
1751
- a.train(:nothobbies, "cashier;", "word")
1752
- a.train(:nothobbies, "stocker;", "word")
1753
- a.train(:nothobbies, "barber;", "word")
1754
- a.train(:nothobbies, "stylist;", "word")
1755
- a.train(:nothobbies, "clerk;", "word")
1756
- a.train(:nothobbies, "butcher;", "word")
1757
- a.train(:nothobbies, "reporter;", "word")
1758
- a.train(:nothobbies, "manager;", "word")
1759
- a.train(:nothobbies, "crane;", "word")
1760
- a.train(:nothobbies, "lawyer;", "word")
1761
- a.train(:nothobbies, "cameraman;", "word")
1762
- a.train(:nothobbies, "engineer;", "word")
1763
- a.train(:nothobbies, "pilot;", "word")
1764
- a.train(:nothobbies, "nursing:", "word")
1765
- a.train(:nothobbies, "officer:", "word")
1766
- a.train(:nothobbies, "fireman:", "word")
1767
- a.train(:nothobbies, "cashier:", "word")
1768
- a.train(:nothobbies, "stocker:", "word")
1769
- a.train(:nothobbies, "barber:", "word")
1770
- a.train(:nothobbies, "stylist:", "word")
1771
- a.train(:nothobbies, "clerk:", "word")
1772
- a.train(:nothobbies, "butcher:", "word")
1773
- a.train(:nothobbies, "reporter:", "word")
1774
- a.train(:nothobbies, "manager:", "word")
1775
- a.train(:nothobbies, "crane:", "word")
1776
- a.train(:nothobbies, "lawyer:", "word")
1777
- a.train(:nothobbies, "cameraman:", "word")
1778
- a.train(:nothobbies, "engineer:", "word")
1779
- a.train(:nothobbies, "pilot:", "word")
1780
- a.train(:nothobbies, "nursing?", "word")
1781
- a.train(:nothobbies, "officer?", "word")
1782
- a.train(:nothobbies, "fireman?", "word")
1783
- a.train(:nothobbies, "cashier?", "word")
1784
- a.train(:nothobbies, "stocker?", "word")
1785
- a.train(:nothobbies, "barber?", "word")
1786
- a.train(:nothobbies, "stylist?", "word")
1787
- a.train(:nothobbies, "clerk?", "word")
1788
- a.train(:nothobbies, "butcher?", "word")
1789
- a.train(:nothobbies, "reporter?", "word")
1790
- a.train(:nothobbies, "manager?", "word")
1791
- a.train(:nothobbies, "crane?", "word")
1792
- a.train(:nothobbies, "lawyer?", "word")
1793
- a.train(:nothobbies, "cameraman?", "word")
1794
- a.train(:nothobbies, "engineer?", "word")
1795
- a.train(:nothobbies, "pilot?", "word")
1796
- a.train(:nothobbies, "nursing", "word")
1797
- a.train(:nothobbies, "arresting", "word")
1798
- a.train(:nothobbies, "hosing", "word")
1799
- a.train(:nothobbies, "cashing", "word")
1800
- a.train(:nothobbies, "stocking", "word")
1801
- a.train(:nothobbies, "barbing", "word")
1802
- a.train(:nothobbies, "styling", "word")
1803
- a.train(:nothobbies, "clerking", "word")
1804
- a.train(:nothobbies, "chopping", "word")
1805
- a.train(:nothobbies, "reporting", "word")
1806
- a.train(:nothobbies, "managing", "word")
1807
- a.train(:nothobbies, "craning", "word")
1808
- a.train(:nothobbies, "representing", "word")
1809
- a.train(:nothobbies, "recording", "word")
1810
- a.train(:nothobbies, "engineering", "word")
1811
- a.train(:nothobbies, "piloting", "word")
1812
- a.train(:nothobbies, "nursing.", "word")
1813
- a.train(:nothobbies, "arresting.", "word")
1814
- a.train(:nothobbies, "hosing.", "word")
1815
- a.train(:nothobbies, "cashing.", "word")
1816
- a.train(:nothobbies, "stocking.", "word")
1817
- a.train(:nothobbies, "barbing.", "word")
1818
- a.train(:nothobbies, "styling.", "word")
1819
- a.train(:nothobbies, "clerking.", "word")
1820
- a.train(:nothobbies, "chopping.", "word")
1821
- a.train(:nothobbies, "reporting.", "word")
1822
- a.train(:nothobbies, "managing.", "word")
1823
- a.train(:nothobbies, "craning.", "word")
1824
- a.train(:nothobbies, "representing.", "word")
1825
- a.train(:nothobbies, "recording.", "word")
1826
- a.train(:nothobbies, "engineering.", "word")
1827
- a.train(:nothobbies, "piloting.", "word")
1828
- a.train(:nothobbies, "nursing;", "word")
1829
- a.train(:nothobbies, "arresting;", "word")
1830
- a.train(:nothobbies, "hosing;", "word")
1831
- a.train(:nothobbies, "cashing;", "word")
1832
- a.train(:nothobbies, "stocking;", "word")
1833
- a.train(:nothobbies, "barbing;", "word")
1834
- a.train(:nothobbies, "styling;", "word")
1835
- a.train(:nothobbies, "clerking;", "word")
1836
- a.train(:nothobbies, "chopping;", "word")
1837
- a.train(:nothobbies, "reporting;", "word")
1838
- a.train(:nothobbies, "managing;", "word")
1839
- a.train(:nothobbies, "craning;", "word")
1840
- a.train(:nothobbies, "representing;", "word")
1841
- a.train(:nothobbies, "recording;", "word")
1842
- a.train(:nothobbies, "engineering;", "word")
1843
- a.train(:nothobbies, "piloting;", "word")
1844
- a.train(:nothobbies, "nursing:", "word")
1845
- a.train(:nothobbies, "arresting:", "word")
1846
- a.train(:nothobbies, "hosing:", "word")
1847
- a.train(:nothobbies, "cashing:", "word")
1848
- a.train(:nothobbies, "stocking:", "word")
1849
- a.train(:nothobbies, "barbing:", "word")
1850
- a.train(:nothobbies, "styling:", "word")
1851
- a.train(:nothobbies, "clerking:", "word")
1852
- a.train(:nothobbies, "chopping:", "word")
1853
- a.train(:nothobbies, "reporting:", "word")
1854
- a.train(:nothobbies, "managing:", "word")
1855
- a.train(:nothobbies, "craning:", "word")
1856
- a.train(:nothobbies, "representing:", "word")
1857
- a.train(:nothobbies, "recording:", "word")
1858
- a.train(:nothobbies, "engineering:", "word")
1859
- a.train(:nothobbies, "piloting:", "word")
1860
- a.train(:nothobbies, "nursing?", "word")
1861
- a.train(:nothobbies, "arresting?", "word")
1862
- a.train(:nothobbies, "hosing?", "word")
1863
- a.train(:nothobbies, "cashing?", "word")
1864
- a.train(:nothobbies, "stocking?", "word")
1865
- a.train(:nothobbies, "barbing?", "word")
1866
- a.train(:nothobbies, "styling?", "word")
1867
- a.train(:nothobbies, "clerking?", "word")
1868
- a.train(:nothobbies, "chopping?", "word")
1869
- a.train(:nothobbies, "reporting?", "word")
1870
- a.train(:nothobbies, "managing?", "word")
1871
- a.train(:nothobbies, "craning?", "word")
1872
- a.train(:nothobbies, "representing?", "word")
1873
- a.train(:nothobbies, "recording?", "word")
1874
- a.train(:nothobbies, "engineering?", "word")
1875
- a.train(:nothobbies, "piloting?", "word")
1876
-
1877
- # Chatbot process for asking about pets.
1878
- print "#{bot_name}: What do you do to pass the time?\n#{your_name}: "
1879
- b = gets.chomp.split(' ')
1880
-
1881
- # Classify b and convert to string.
1882
- a_class = a.classify(*b)
1883
- result = a_class[0]
1884
- decision = result.to_s
1885
-
1886
- if decision == "pets"
1887
- puts "#{bot_name}: Is that a good passtime?"
1888
- else
1889
- puts "#{bot_name}: I did not know you could do that for fun."
1890
- end
1891
- end
1336
+ bot_name = File.read("bot_identity/bot_name.txt").strip
1337
+ your_name = File.read("your_identity/your_name.txt").strip
1892
1338
 
1893
- # Checks if what you reference is a job.
1894
- def self.check_jobs
1895
- bot_name = File.read("bot_identity/bot_name.txt").strip
1896
- your_name = File.read("your_identity/your_identity.txt").strip
1897
-
1898
- a = NaiveBayes.new(:jobs, :notjobs)
1899
-
1900
- # Not Jobs
1901
- a.train(:notjobs, "sing", "word")
1902
- a.train(:notjobs, "illustrate", "word")
1903
- a.train(:notjobs, "draw", "word")
1904
- a.train(:notjobs, "write", "word")
1905
- a.train(:notjobs, "widdle", "word")
1906
- a.train(:notjobs, "dance", "word")
1907
- a.train(:notjobs, "clog", "word")
1908
- a.train(:notjobs, "weave", "word")
1909
- a.train(:notjobs, "crochet", "word")
1910
- a.train(:notjobs, "knit", "word")
1911
- a.train(:notjobs, "swim", "word")
1912
- a.train(:notjobs, "BDSM", "word")
1913
- a.train(:notjobs, "game", "word")
1914
- a.train(:notjobs, "JRPG", "word")
1915
- a.train(:notjobs, "MMORPG", "word")
1916
- a.train(:notjobs, "FPS", "word")
1917
- a.train(:notjobs, "SIM", "word")
1918
- a.train(:notjobs, "metroidvania", "word")
1919
- a.train(:notjobs, "football", "word")
1920
- a.train(:notjobs, "baseball", "word")
1921
- a.train(:notjobs, "soccer", "word")
1922
- a.train(:notjobs, "volleyball", "word")
1923
- a.train(:notjobs, "skateboard", "word")
1924
- a.train(:notjobs, "bike", "word")
1925
- a.train(:notjobs, "skate", "word")
1926
- a.train(:notjobs, "sing.", "word")
1927
- a.train(:notjobs, "illustrate.", "word")
1928
- a.train(:notjobs, "draw.", "word")
1929
- a.train(:notjobs, "write.", "word")
1930
- a.train(:notjobs, "widdle.", "word")
1931
- a.train(:notjobs, "dance.", "word")
1932
- a.train(:notjobs, "clog.", "word")
1933
- a.train(:notjobs, "weave.", "word")
1934
- a.train(:notjobs, "crochet.", "word")
1935
- a.train(:notjobs, "knit.", "word")
1936
- a.train(:notjobs, "swim.", "word")
1937
- a.train(:notjobs, "BDSM.", "word")
1938
- a.train(:notjobs, "game.", "word")
1939
- a.train(:notjobs, "JRPG.", "word")
1940
- a.train(:notjobs, "MMORPG.", "word")
1941
- a.train(:notjobs, "FPS.", "word")
1942
- a.train(:notjobs, "SIM.", "word")
1943
- a.train(:notjobs, "metroidvania.", "word")
1944
- a.train(:notjobs, "football.", "word")
1945
- a.train(:notjobs, "baseball.", "word")
1946
- a.train(:notjobs, "soccer.", "word")
1947
- a.train(:notjobs, "volleyball.", "word")
1948
- a.train(:notjobs, "skateboard.", "word")
1949
- a.train(:notjobs, "bike.", "word")
1950
- a.train(:notjobs, "skate.", "word")
1951
- a.train(:notjobs, "sing;", "word")
1952
- a.train(:notjobs, "illustrate;", "word")
1953
- a.train(:notjobs, "draw;", "word")
1954
- a.train(:notjobs, "write;", "word")
1955
- a.train(:notjobs, "widdle;", "word")
1956
- a.train(:notjobs, "dance;", "word")
1957
- a.train(:notjobs, "clog;", "word")
1958
- a.train(:notjobs, "weave;", "word")
1959
- a.train(:notjobs, "crochet;", "word")
1960
- a.train(:notjobs, "knit;", "word")
1961
- a.train(:notjobs, "swim;", "word")
1962
- a.train(:notjobs, "BDSM;", "word")
1963
- a.train(:notjobs, "game;", "word")
1964
- a.train(:notjobs, "JRPG;", "word")
1965
- a.train(:notjobs, "MMORPG;", "word")
1966
- a.train(:notjobs, "FPS;", "word")
1967
- a.train(:notjobs, "SIM;", "word")
1968
- a.train(:notjobs, "metroidvania;", "word")
1969
- a.train(:notjobs, "football;", "word")
1970
- a.train(:notjobs, "baseball;", "word")
1971
- a.train(:notjobs, "soccer;", "word")
1972
- a.train(:notjobs, "volleyball;", "word")
1973
- a.train(:notjobs, "skateboard;", "word")
1974
- a.train(:notjobs, "bike;", "word")
1975
- a.train(:notjobs, "skate;", "word")
1976
- a.train(:notjobs, "sing:", "word")
1977
- a.train(:notjobs, "illustrate:", "word")
1978
- a.train(:notjobs, "draw:", "word")
1979
- a.train(:notjobs, "write:", "word")
1980
- a.train(:notjobs, "widdle:", "word")
1981
- a.train(:notjobs, "dance:", "word")
1982
- a.train(:notjobs, "clog:", "word")
1983
- a.train(:notjobs, "weave:", "word")
1984
- a.train(:notjobs, "crochet:", "word")
1985
- a.train(:notjobs, "knit:", "word")
1986
- a.train(:notjobs, "swim:", "word")
1987
- a.train(:notjobs, "BDSM:", "word")
1988
- a.train(:notjobs, "game:", "word")
1989
- a.train(:notjobs, "JRPG:", "word")
1990
- a.train(:notjobs, "MMORPG:", "word")
1991
- a.train(:notjobs, "FPS:", "word")
1992
- a.train(:notjobs, "SIM:", "word")
1993
- a.train(:notjobs, "metroidvania:", "word")
1994
- a.train(:notjobs, "football:", "word")
1995
- a.train(:notjobs, "baseball:", "word")
1996
- a.train(:notjobs, "soccer:", "word")
1997
- a.train(:notjobs, "volleyball:", "word")
1998
- a.train(:notjobs, "skateboard:", "word")
1999
- a.train(:notjobs, "bike:", "word")
2000
- a.train(:notjobs, "skate:", "word")
2001
- a.train(:notjobs, "sing?", "word")
2002
- a.train(:notjobs, "illustrate?", "word")
2003
- a.train(:notjobs, "draw?", "word")
2004
- a.train(:notjobs, "write?", "word")
2005
- a.train(:notjobs, "widdle?", "word")
2006
- a.train(:notjobs, "dance?", "word")
2007
- a.train(:notjobs, "clog?", "word")
2008
- a.train(:notjobs, "weave?", "word")
2009
- a.train(:notjobs, "crochet?", "word")
2010
- a.train(:notjobs, "knit?", "word")
2011
- a.train(:notjobs, "swim?", "word")
2012
- a.train(:notjobs, "BDSM?", "word")
2013
- a.train(:notjobs, "game?", "word")
2014
- a.train(:notjobs, "JRPG?", "word")
2015
- a.train(:notjobs, "MMORPG?", "word")
2016
- a.train(:notjobs, "FPS?", "word")
2017
- a.train(:notjobs, "SIM?", "word")
2018
- a.train(:notjobs, "metroidvania?", "word")
2019
- a.train(:notjobs, "football?", "word")
2020
- a.train(:notjobs, "baseball?", "word")
2021
- a.train(:notjobs, "soccer?", "word")
2022
- a.train(:notjobs, "volleyball?", "word")
2023
- a.train(:notjobs, "skateboard?", "word")
2024
- a.train(:notjobs, "bike?", "word")
2025
- a.train(:notjobs, "skate?", "word")
2026
-
2027
- # Are Jobs
2028
- a.train(:jobs, "nurse", "word")
2029
- a.train(:jobs, "officer", "word")
2030
- a.train(:jobs, "fireman", "word")
2031
- a.train(:jobs, "cashier", "word")
2032
- a.train(:jobs, "stocker", "word")
2033
- a.train(:jobs, "barber", "word")
2034
- a.train(:jobs, "stylist", "word")
2035
- a.train(:jobs, "clerk", "word")
2036
- a.train(:jobs, "butcher", "word")
2037
- a.train(:jobs, "reporter", "word")
2038
- a.train(:jobs, "manager", "word")
2039
- a.train(:jobs, "crane", "word")
2040
- a.train(:jobs, "lawyer", "word")
2041
- a.train(:jobs, "cameraman", "word")
2042
- a.train(:jobs, "engineer", "word")
2043
- a.train(:jobs, "pilot", "word")
2044
- a.train(:jobs, "nurse.", "word")
2045
- a.train(:jobs, "officer.", "word")
2046
- a.train(:jobs, "fireman.", "word")
2047
- a.train(:jobs, "cashier.", "word")
2048
- a.train(:jobs, "stocker.", "word")
2049
- a.train(:jobs, "barber.", "word")
2050
- a.train(:jobs, "stylist.", "word")
2051
- a.train(:jobs, "clerk.", "word")
2052
- a.train(:jobs, "butcher.", "word")
2053
- a.train(:jobs, "reporter.", "word")
2054
- a.train(:jobs, "manager.", "word")
2055
- a.train(:jobs, "crane.", "word")
2056
- a.train(:jobs, "lawyer.", "word")
2057
- a.train(:jobs, "cameraman.", "word")
2058
- a.train(:jobs, "engineer.", "word")
2059
- a.train(:jobs, "pilot.", "word")
2060
- a.train(:jobs, "nurse;", "word")
2061
- a.train(:jobs, "officer;", "word")
2062
- a.train(:jobs, "fireman;", "word")
2063
- a.train(:jobs, "cashier;", "word")
2064
- a.train(:jobs, "stocker;", "word")
2065
- a.train(:jobs, "barber;", "word")
2066
- a.train(:jobs, "stylist;", "word")
2067
- a.train(:jobs, "clerk;", "word")
2068
- a.train(:jobs, "butcher;", "word")
2069
- a.train(:jobs, "reporter;", "word")
2070
- a.train(:jobs, "manager;", "word")
2071
- a.train(:jobs, "crane;", "word")
2072
- a.train(:jobs, "lawyer;", "word")
2073
- a.train(:jobs, "cameraman;", "word")
2074
- a.train(:jobs, "engineer;", "word")
2075
- a.train(:jobs, "pilot;", "word")
2076
- a.train(:jobs, "nurse:", "word")
2077
- a.train(:jobs, "officer:", "word")
2078
- a.train(:jobs, "fireman:", "word")
2079
- a.train(:jobs, "cashier:", "word")
2080
- a.train(:jobs, "stocker:", "word")
2081
- a.train(:jobs, "barber:", "word")
2082
- a.train(:jobs, "stylist:", "word")
2083
- a.train(:jobs, "clerk:", "word")
2084
- a.train(:jobs, "butcher:", "word")
2085
- a.train(:jobs, "reporter:", "word")
2086
- a.train(:jobs, "manager:", "word")
2087
- a.train(:jobs, "crane:", "word")
2088
- a.train(:jobs, "lawyer:", "word")
2089
- a.train(:jobs, "cameraman:", "word")
2090
- a.train(:jobs, "engineer:", "word")
2091
- a.train(:jobs, "pilot:", "word")
2092
- a.train(:jobs, "nurse?", "word")
2093
- a.train(:jobs, "officer?", "word")
2094
- a.train(:jobs, "fireman?", "word")
2095
- a.train(:jobs, "cashier?", "word")
2096
- a.train(:jobs, "stocker?", "word")
2097
- a.train(:jobs, "barber?", "word")
2098
- a.train(:jobs, "stylist?", "word")
2099
- a.train(:jobs, "clerk?", "word")
2100
- a.train(:jobs, "butcher?", "word")
2101
- a.train(:jobs, "reporter?", "word")
2102
- a.train(:jobs, "manager?", "word")
2103
- a.train(:jobs, "crane?", "word")
2104
- a.train(:jobs, "lawyer?", "word")
2105
- a.train(:jobs, "cameraman?", "word")
2106
- a.train(:jobs, "engineer?", "word")
2107
- a.train(:jobs, "pilot?", "word")
2108
-
2109
- # Chatbot process for asking about pets.
2110
- print "#{bot_name}: What do you do for a living?\n#{your_name}: "
2111
- b = gets.chomp.split(' ')
2112
-
2113
- # Classify b and convert to string.
2114
- a_class = a.classify(*b)
2115
- result = a_class[0]
2116
- decision = result.to_s
2117
-
2118
- if decision == "jobs"
2119
- puts "#{bot_name}: Do you like that job?"
2120
- else
2121
- puts "#{bot_name}: I did not know you make a living doing that."
2122
- end
2123
- end
1339
+ puts "#{bot_name}: #{personality_details}"
2124
1340
 
2125
- # Checks if what you reference is a skill.
2126
- def self.check_skills
2127
- bot_name = File.read("bot_identity/bot_name.txt").strip
2128
- your_name = File.read("your_identity/your_identity.txt").strip
2129
-
2130
- a = NaiveBayes.new(:skills, :notskills)
2131
-
2132
- # Are Skills
2133
- a.train(:skills, "codebreak", "word")
2134
- a.train(:skills, "cook", "word")
2135
- a.train(:skills, "climb", "word")
2136
- a.train(:skills, "yoddle", "word")
2137
- a.train(:skills, "blacksmith", "word")
2138
- a.train(:skills, "codebreak.", "word")
2139
- a.train(:skills, "cook.", "word")
2140
- a.train(:skills, "climb.", "word")
2141
- a.train(:skills, "yoddle.", "word")
2142
- a.train(:skills, "blacksmith.", "word")
2143
- a.train(:skills, "codebreak;", "word")
2144
- a.train(:skills, "cook;", "word")
2145
- a.train(:skills, "climb;", "word")
2146
- a.train(:skills, "yoddle;", "word")
2147
- a.train(:skills, "blacksmith;", "word")
2148
- a.train(:skills, "codebreak:", "word")
2149
- a.train(:skills, "cook:", "word")
2150
- a.train(:skills, "climb:", "word")
2151
- a.train(:skills, "yoddle:", "word")
2152
- a.train(:skills, "blacksmith:", "word")
2153
- a.train(:skills, "codebreak?", "word")
2154
- a.train(:skills, "cook?", "word")
2155
- a.train(:skills, "climb?", "word")
2156
- a.train(:skills, "yoddle?", "word")
2157
- a.train(:skills, "blacksmith?", "word")
2158
-
2159
- # Are Not Skills
2160
- a.train(:notskills, "nurse", "word")
2161
- a.train(:notskills, "officer", "word")
2162
- a.train(:notskills, "fireman", "word")
2163
- a.train(:notskills, "cashier", "word")
2164
- a.train(:notskills, "stocker", "word")
2165
- a.train(:notskills, "barber", "word")
2166
- a.train(:notskills, "stylist", "word")
2167
- a.train(:notskills, "clerk", "word")
2168
- a.train(:notskills, "butcher", "word")
2169
- a.train(:notskills, "reporter", "word")
2170
- a.train(:notskills, "manager", "word")
2171
- a.train(:notskills, "crane", "word")
2172
- a.train(:notskills, "lawyer", "word")
2173
- a.train(:notskills, "cameraman", "word")
2174
- a.train(:notskills, "engineer", "word")
2175
- a.train(:notskills, "pilot", "word")
2176
- a.train(:notskills, "nurse.", "word")
2177
- a.train(:notskills, "officer.", "word")
2178
- a.train(:notskills, "fireman.", "word")
2179
- a.train(:notskills, "cashier.", "word")
2180
- a.train(:notskills, "stocker.", "word")
2181
- a.train(:notskills, "barber.", "word")
2182
- a.train(:notskills, "stylist.", "word")
2183
- a.train(:notskills, "clerk.", "word")
2184
- a.train(:notskills, "butcher.", "word")
2185
- a.train(:notskills, "reporter.", "word")
2186
- a.train(:notskills, "manager.", "word")
2187
- a.train(:notskills, "crane.", "word")
2188
- a.train(:notskills, "lawyer.", "word")
2189
- a.train(:notskills, "cameraman.", "word")
2190
- a.train(:notskills, "engineer.", "word")
2191
- a.train(:notskills, "pilot.", "word")
2192
- a.train(:notskills, "nurse?", "word")
2193
- a.train(:notskills, "officer?", "word")
2194
- a.train(:notskills, "fireman?", "word")
2195
- a.train(:notskills, "cashier?", "word")
2196
- a.train(:notskills, "stocker?", "word")
2197
- a.train(:notskills, "barber?", "word")
2198
- a.train(:notskills, "stylist?", "word")
2199
- a.train(:notskills, "clerk?", "word")
2200
- a.train(:notskills, "butcher?", "word")
2201
- a.train(:notskills, "reporter?", "word")
2202
- a.train(:notskills, "manager?", "word")
2203
- a.train(:notskills, "crane?", "word")
2204
- a.train(:notskills, "lawyer?", "word")
2205
- a.train(:notskills, "cameraman?", "word")
2206
- a.train(:notskills, "engineer?", "word")
2207
- a.train(:notskills, "pilot?", "word")
2208
-
2209
- # Chatbot process for asking about pets.
2210
- print "#{bot_name}: What would you say is your skill?\n#{your_name}: "
2211
- b = gets.chomp.split(' ')
2212
-
2213
- # Classify b and convert to string.
2214
- a_class = a.classify(*b)
2215
- result = a_class[0]
2216
- decision = result.to_s
2217
-
2218
- if decision == "skills"
2219
- puts "#{bot_name}: Would you ever consider changing your skills?"
2220
- else
2221
- puts "#{bot_name}: I thought that was a job, and not a skill."
2222
- end
2223
- end
1341
+ a = NaiveBayes.new(:pets, :hobbies, :jobs, :skills, :weather)
2224
1342
 
2225
- # Cheks if what you reference is a weather pattern.
2226
- def self.check_weather
2227
- bot_name = File.read("bot_identity/bot_name.txt").strip
2228
- your_name = File.read("your_identity/your_identity.txt").strip
2229
-
2230
- a = NaiveBayes.new(:weather, :notweather)
2231
-
2232
- # Is a weather pattern
2233
- a.train(:weather, "sunny", "word")
2234
- a.train(:weather, "rainy", "word")
2235
- a.train(:weather, "cloudy", "word")
2236
- a.train(:weather, "foggy", "word")
2237
- a.train(:weather, "humid", "word")
2238
-
2239
- # Is not a weather pattern.
2240
- a.train(:notweather, "pilot", "word")
2241
- a.train(:notweather, "sundance", "word")
2242
- a.train(:notweather, "officer", "word")
2243
- a.train(:notweather, "cashier", "word")
2244
- a.train(:notweather, "elephany", "word")
2245
-
2246
- # Chatbot process for asking about pets.
2247
- print "#{bot_name}: What is the weather currently?\n#{your_name}: "
2248
- b = gets.chomp.split(' ')
2249
-
2250
- # Classify b and convert to string.
2251
- a_class = a.classify(*b)
2252
- result = a_class[0]
2253
- decision = result.to_s
2254
-
2255
- if decision == "skills"
2256
- puts "#{bot_name}: Some people like the rain, others the snow. It really varies!"
2257
- else
2258
- puts "#{bot_name}: I didn't know that was a weather pattern."
2259
- end
2260
- end
1343
+ # Pets
1344
+ a.train(:pets, "dog", "word")
1345
+ a.train(:pets, "cat", "word")
1346
+ a.train(:pets, "rat", "word")
1347
+ a.train(:pets, "gerbil", "word")
1348
+ a.train(:pets, "hamster", "word")
1349
+ a.train(:pets, "snake", "word")
1350
+ a.train(:pets, "monkey", "word")
1351
+ a.train(:pets, "dog.", "word")
1352
+ a.train(:pets, "cat.", "word")
1353
+ a.train(:pets, "rat.", "word")
1354
+ a.train(:pets, "gerbil.", "word")
1355
+ a.train(:pets, "hamster.", "word")
1356
+ a.train(:pets, "snake.", "word")
1357
+ a.train(:pets, "monkey.", "word")
1358
+ a.train(:pets, "dog;", "word")
1359
+ a.train(:pets, "cat;", "word")
1360
+ a.train(:pets, "rat;", "word")
1361
+ a.train(:pets, "gerbil;", "word")
1362
+ a.train(:pets, "hamster;", "word")
1363
+ a.train(:pets, "snake;", "word")
1364
+ a.train(:pets, "monkey;", "word")
1365
+ a.train(:pets, "dog:", "word")
1366
+ a.train(:pets, "cat:", "word")
1367
+ a.train(:pets, "rat:", "word")
1368
+ a.train(:pets, "gerbil:", "word")
1369
+ a.train(:pets, "hamster:", "word")
1370
+ a.train(:pets, "snake:", "word")
1371
+ a.train(:pets, "monkey:", "word")
1372
+ a.train(:pets, "dog?", "word")
1373
+ a.train(:pets, "cat?", "word")
1374
+ a.train(:pets, "rat?", "word")
1375
+ a.train(:pets, "gerbil?", "word")
1376
+ a.train(:pets, "hamster?", "word")
1377
+ a.train(:pets, "snake?", "word")
1378
+ a.train(:pets, "monkey?", "word")
2261
1379
 
2262
- iteration = File.read("data/iteration.txt") # Controls the sleep time between personality details and input.
1380
+ # Hobbies
1381
+ a.train(:hobbies, "sing", "word")
1382
+ a.train(:hobbies, "illustrate", "word")
1383
+ a.train(:hobbies, "draw", "word")
1384
+ a.train(:hobbies, "write", "word")
1385
+ a.train(:hobbies, "widdle", "word")
1386
+ a.train(:hobbies, "dance", "word")
1387
+ a.train(:hobbies, "clog", "word")
1388
+ a.train(:hobbies, "weave", "word")
1389
+ a.train(:hobbies, "crochet", "word")
1390
+ a.train(:hobbies, "knit", "word")
1391
+ a.train(:hobbies, "swim", "word")
1392
+ a.train(:hobbies, "BDSM", "word")
1393
+ a.train(:hobbies, "game", "word")
1394
+ a.train(:hobbies, "JRPG", "word")
1395
+ a.train(:hobbies, "MMORPG", "word")
1396
+ a.train(:hobbies, "FPS", "word")
1397
+ a.train(:hobbies, "SIM", "word")
1398
+ a.train(:hobbies, "metroidvania", "word")
1399
+ a.train(:hobbies, "football", "word")
1400
+ a.train(:hobbies, "baseball", "word")
1401
+ a.train(:hobbies, "soccer", "word")
1402
+ a.train(:hobbies, "volleyball", "word")
1403
+ a.train(:hobbies, "skateboard", "word")
1404
+ a.train(:hobbies, "bike", "word")
1405
+ a.train(:hobbies, "skate", "word")
1406
+ a.train(:hobbies, "sing.", "word")
1407
+ a.train(:hobbies, "illustrate.", "word")
1408
+ a.train(:hobbies, "draw.", "word")
1409
+ a.train(:hobbies, "write.", "word")
1410
+ a.train(:hobbies, "widdle.", "word")
1411
+ a.train(:hobbies, "dance.", "word")
1412
+ a.train(:hobbies, "clog.", "word")
1413
+ a.train(:hobbies, "weave.", "word")
1414
+ a.train(:hobbies, "crochet.", "word")
1415
+ a.train(:hobbies, "knit.", "word")
1416
+ a.train(:hobbies, "swim.", "word")
1417
+ a.train(:hobbies, "BDSM.", "word")
1418
+ a.train(:hobbies, "game.", "word")
1419
+ a.train(:hobbies, "JRPG.", "word")
1420
+ a.train(:hobbies, "MMORPG.", "word")
1421
+ a.train(:hobbies, "FPS.", "word")
1422
+ a.train(:hobbies, "SIM.", "word")
1423
+ a.train(:hobbies, "metroidvania.", "word")
1424
+ a.train(:hobbies, "football.", "word")
1425
+ a.train(:hobbies, "baseball.", "word")
1426
+ a.train(:hobbies, "soccer.", "word")
1427
+ a.train(:hobbies, "volleyball.", "word")
1428
+ a.train(:hobbies, "skateboard.", "word")
1429
+ a.train(:hobbies, "bike.", "word")
1430
+ a.train(:hobbies, "skate.", "word")
1431
+ a.train(:hobbies, "sing;", "word")
1432
+ a.train(:hobbies, "illustrate;", "word")
1433
+ a.train(:hobbies, "draw;", "word")
1434
+ a.train(:hobbies, "write;", "word")
1435
+ a.train(:hobbies, "widdle;", "word")
1436
+ a.train(:hobbies, "dance;", "word")
1437
+ a.train(:hobbies, "clog;", "word")
1438
+ a.train(:hobbies, "weave;", "word")
1439
+ a.train(:hobbies, "crochet;", "word")
1440
+ a.train(:hobbies, "knit;", "word")
1441
+ a.train(:hobbies, "swim;", "word")
1442
+ a.train(:hobbies, "BDSM;", "word")
1443
+ a.train(:hobbies, "game;", "word")
1444
+ a.train(:hobbies, "JRPG;", "word")
1445
+ a.train(:hobbies, "MMORPG;", "word")
1446
+ a.train(:hobbies, "FPS;", "word")
1447
+ a.train(:hobbies, "SIM;", "word")
1448
+ a.train(:hobbies, "metroidvania;", "word")
1449
+ a.train(:hobbies, "football;", "word")
1450
+ a.train(:hobbies, "baseball;", "word")
1451
+ a.train(:hobbies, "soccer;", "word")
1452
+ a.train(:hobbies, "volleyball;", "word")
1453
+ a.train(:hobbies, "skateboard;", "word")
1454
+ a.train(:hobbies, "bike;", "word")
1455
+ a.train(:hobbies, "skate;", "word")
1456
+ a.train(:hobbies, "sing:", "word")
1457
+ a.train(:hobbies, "illustrate:", "word")
1458
+ a.train(:hobbies, "draw:", "word")
1459
+ a.train(:hobbies, "write:", "word")
1460
+ a.train(:hobbies, "widdle:", "word")
1461
+ a.train(:hobbies, "dance:", "word")
1462
+ a.train(:hobbies, "clog:", "word")
1463
+ a.train(:hobbies, "weave:", "word")
1464
+ a.train(:hobbies, "crochet:", "word")
1465
+ a.train(:hobbies, "knit:", "word")
1466
+ a.train(:hobbies, "swim:", "word")
1467
+ a.train(:hobbies, "BDSM:", "word")
1468
+ a.train(:hobbies, "game:", "word")
1469
+ a.train(:hobbies, "JRPG:", "word")
1470
+ a.train(:hobbies, "MMORPG:", "word")
1471
+ a.train(:hobbies, "FPS:", "word")
1472
+ a.train(:hobbies, "SIM:", "word")
1473
+ a.train(:hobbies, "metroidvania:", "word")
1474
+ a.train(:hobbies, "football:", "word")
1475
+ a.train(:hobbies, "baseball:", "word")
1476
+ a.train(:hobbies, "soccer:", "word")
1477
+ a.train(:hobbies, "volleyball:", "word")
1478
+ a.train(:hobbies, "skateboard:", "word")
1479
+ a.train(:hobbies, "bike:", "word")
1480
+ a.train(:hobbies, "skate:", "word")
1481
+ a.train(:hobbies, "sing?", "word")
1482
+ a.train(:hobbies, "illustrate?", "word")
1483
+ a.train(:hobbies, "draw?", "word")
1484
+ a.train(:hobbies, "write?", "word")
1485
+ a.train(:hobbies, "widdle?", "word")
1486
+ a.train(:hobbies, "dance?", "word")
1487
+ a.train(:hobbies, "clog?", "word")
1488
+ a.train(:hobbies, "weave?", "word")
1489
+ a.train(:hobbies, "crochet?", "word")
1490
+ a.train(:hobbies, "knit?", "word")
1491
+ a.train(:hobbies, "swim?", "word")
1492
+ a.train(:hobbies, "BDSM?", "word")
1493
+ a.train(:hobbies, "game?", "word")
1494
+ a.train(:hobbies, "JRPG?", "word")
1495
+ a.train(:hobbies, "MMORPG?", "word")
1496
+ a.train(:hobbies, "FPS?", "word")
1497
+ a.train(:hobbies, "SIM?", "word")
1498
+ a.train(:hobbies, "metroidvania?", "word")
1499
+ a.train(:hobbies, "football?", "word")
1500
+ a.train(:hobbies, "baseball?", "word")
1501
+ a.train(:hobbies, "soccer?", "word")
1502
+ a.train(:hobbies, "volleyball?", "word")
1503
+ a.train(:hobbies, "skateboard?", "word")
1504
+ a.train(:hobbies, "bike?", "word")
1505
+ a.train(:hobbies, "skate?", "word")
2263
1506
 
2264
- bot_name = File.read("bot_identity/bot_name.txt").strip # Assigns chatbot name from a file. Defaults to SyncMind.
1507
+ # Jobs
1508
+ a.train(:jobs, "nurse", "word")
1509
+ a.train(:jobs, "officer", "word")
1510
+ a.train(:jobs, "fireman", "word")
1511
+ a.train(:jobs, "cashier", "word")
1512
+ a.train(:jobs, "stocker", "word")
1513
+ a.train(:jobs, "barber", "word")
1514
+ a.train(:jobs, "stylist", "word")
1515
+ a.train(:jobs, "clerk", "word")
1516
+ a.train(:jobs, "butcher", "word")
1517
+ a.train(:jobs, "reporter", "word")
1518
+ a.train(:jobs, "manager", "word")
1519
+ a.train(:jobs, "crane", "word")
1520
+ a.train(:jobs, "lawyer", "word")
1521
+ a.train(:jobs, "cameraman", "word")
1522
+ a.train(:jobs, "engineer", "word")
1523
+ a.train(:jobs, "pilot", "word")
1524
+ a.train(:jobs, "nurse.", "word")
1525
+ a.train(:jobs, "officer.", "word")
1526
+ a.train(:jobs, "fireman.", "word")
1527
+ a.train(:jobs, "cashier.", "word")
1528
+ a.train(:jobs, "stocker.", "word")
1529
+ a.train(:jobs, "barber.", "word")
1530
+ a.train(:jobs, "stylist.", "word")
1531
+ a.train(:jobs, "clerk.", "word")
1532
+ a.train(:jobs, "butcher.", "word")
1533
+ a.train(:jobs, "reporter.", "word")
1534
+ a.train(:jobs, "manager.", "word")
1535
+ a.train(:jobs, "crane.", "word")
1536
+ a.train(:jobs, "lawyer.", "word")
1537
+ a.train(:jobs, "cameraman.", "word")
1538
+ a.train(:jobs, "engineer.", "word")
1539
+ a.train(:jobs, "pilot.", "word")
1540
+ a.train(:jobs, "nurse;", "word")
1541
+ a.train(:jobs, "officer;", "word")
1542
+ a.train(:jobs, "fireman;", "word")
1543
+ a.train(:jobs, "cashier;", "word")
1544
+ a.train(:jobs, "stocker;", "word")
1545
+ a.train(:jobs, "barber;", "word")
1546
+ a.train(:jobs, "stylist;", "word")
1547
+ a.train(:jobs, "clerk;", "word")
1548
+ a.train(:jobs, "butcher;", "word")
1549
+ a.train(:jobs, "reporter;", "word")
1550
+ a.train(:jobs, "manager;", "word")
1551
+ a.train(:jobs, "crane;", "word")
1552
+ a.train(:jobs, "lawyer;", "word")
1553
+ a.train(:jobs, "cameraman;", "word")
1554
+ a.train(:jobs, "engineer;", "word")
1555
+ a.train(:jobs, "pilot;", "word")
1556
+ a.train(:jobs, "nurse:", "word")
1557
+ a.train(:jobs, "officer:", "word")
1558
+ a.train(:jobs, "fireman:", "word")
1559
+ a.train(:jobs, "cashier:", "word")
1560
+ a.train(:jobs, "stocker:", "word")
1561
+ a.train(:jobs, "barber:", "word")
1562
+ a.train(:jobs, "stylist:", "word")
1563
+ a.train(:jobs, "clerk:", "word")
1564
+ a.train(:jobs, "butcher:", "word")
1565
+ a.train(:jobs, "reporter:", "word")
1566
+ a.train(:jobs, "manager:", "word")
1567
+ a.train(:jobs, "crane:", "word")
1568
+ a.train(:jobs, "lawyer:", "word")
1569
+ a.train(:jobs, "cameraman:", "word")
1570
+ a.train(:jobs, "engineer:", "word")
1571
+ a.train(:jobs, "pilot:", "word")
2265
1572
 
2266
- script = File.readlines("data/script.txt") # The script file the mindfile reads from.
2267
-
2268
- personality_details = script.sample # Personality detail read from a script.
1573
+ # Skills
1574
+ a.train(:skills, "codebreak", "word")
1575
+ a.train(:skills, "cook", "word")
1576
+ a.train(:skills, "climb", "word")
1577
+ a.train(:skills, "yoddle", "word")
1578
+ a.train(:skills, "blacksmith", "word")
1579
+ a.train(:skills, "codebreak.", "word")
1580
+ a.train(:skills, "cook.", "word")
1581
+ a.train(:skills, "climb.", "word")
1582
+ a.train(:skills, "yoddle.", "word")
1583
+ a.train(:skills, "blacksmith.", "word")
1584
+ a.train(:skills, "codebreak;", "word")
1585
+ a.train(:skills, "cook;", "word")
1586
+ a.train(:skills, "climb;", "word")
1587
+ a.train(:skills, "yoddle;", "word")
1588
+ a.train(:skills, "blacksmith;", "word")
1589
+ a.train(:skills, "codebreak:", "word")
1590
+ a.train(:skills, "cook:", "word")
1591
+ a.train(:skills, "climb:", "word")
1592
+ a.train(:skills, "yoddle:", "word")
1593
+ a.train(:skills, "blacksmith:", "word")
1594
+ a.train(:skills, "codebreak?", "word")
1595
+ a.train(:skills, "cook?", "word")
1596
+ a.train(:skills, "climb?", "word")
1597
+ a.train(:skills, "yoddle?", "word")
1598
+ a.train(:skills, "blacksmith?", "word")
2269
1599
 
2270
- # Personality details on a loop.
2271
- puts "#{bot_name}: #{personality_details}"; sleep(iteration)
2272
- print "#{your_name}: "; input = gets.chomp; sleep(iteration)
2273
-
2274
- if input == "I want to talk about pets."; c = check_pets # Goes to baysian pets.
2275
- elsif input == "I want to talk about hobbies."; c = check_hobbies # Goes to baysian hobbies.
2276
- elsif input == "I want to talk about jobs."; c = check_jobs # Goes to baysian jobs.
2277
- elsif input == "I want to talk about skills."; c = check_skills # Goes to baysian skills.
2278
- elsif input == "I want to talk about weather."; c = check_weather # Goes to baysian weather.
2279
- elsif input == "Goodbye!"
2280
- puts "#{bot_name}: Catch you later."
2281
- else # If not other conversational pattern checks out.
2282
- puts "#{bot_name}: I have no idea how to discuss that."
1600
+ # Weather
1601
+ a.train(:weather, "sunny", "word")
1602
+ a.train(:weather, "rainy", "word")
1603
+ a.train(:weather, "cloudy", "word")
1604
+ a.train(:weather, "foggy", "word")
1605
+ a.train(:weather, "humid", "word")
1606
+ a.train(:weather, "sunny.", "word")
1607
+ a.train(:weather, "rainy.", "word")
1608
+ a.train(:weather, "cloudy.", "word")
1609
+ a.train(:weather, "foggy.", "word")
1610
+ a.train(:weather, "humid.", "word")
1611
+ a.train(:weather, "sunny;", "word")
1612
+ a.train(:weather, "rainy;", "word")
1613
+ a.train(:weather, "cloudy;", "word")
1614
+ a.train(:weather, "foggy;", "word")
1615
+ a.train(:weather, "humid;", "word")
1616
+ a.train(:weather, "sunny:", "word")
1617
+ a.train(:weather, "rainy:", "word")
1618
+ a.train(:weather, "cloudy:", "word")
1619
+ a.train(:weather, "foggy:", "word")
1620
+ a.train(:weather, "humid:", "word")
1621
+ a.train(:weather, "sunny?", "word")
1622
+ a.train(:weather, "rainy?", "word")
1623
+ a.train(:weather, "cloudy?", "word")
1624
+ a.train(:weather, "foggy?", "word")
1625
+ a.train(:weather, "humid?", "word")
1626
+
1627
+ # Chatbot process for asking about pets.
1628
+ print "#{bot_name}: How do you do?\n#{your_name}: "
1629
+ b = gets.chomp
1630
+
1631
+ if b == "Goodbye"
1632
+ abort
1633
+ end
1634
+
1635
+ # Classify b and convert to string.
1636
+ a_class = a.classify(*b)
1637
+ result = a_class[0]
1638
+ probability = a_class[1].to_f
1639
+ decision = result.to_s
1640
+
1641
+ # Responce with a pet, hobby, job, skill, or weather rejoinder based on probability.
1642
+ if decision == "pets"
1643
+ if probability >= 1.7741802839285145e-10
1644
+ puts "#{bot_name}: Is that a nice pet?"
1645
+ else
1646
+ puts "#{bot_name}: Sorry but that's not a pet."
1647
+ end
1648
+ elsif decision == "hobbies"
1649
+ if probability >= 1.7741802839285145e-10
1650
+ puts "#{bot_name}: Can you guide me in that hobby?"
1651
+ else
1652
+ puts "#{bot_name}: I don't think that's a hobby."
1653
+ end
1654
+ elsif decision == "jobs"
1655
+ if probability >= 1.7741802839285145e-10
1656
+ puts "#{bot_name}: Do you like that job?"
1657
+ else
1658
+ puts "#{bot_name}: That doesn't seem like a real job."
1659
+ end
1660
+ elsif decision == "skills"
1661
+ if probability >= 1.7741802839285145e-10
1662
+ puts "#{bot_name}: That sounds like an interesting skill."
1663
+ else
1664
+ puts "#{bot_name}: Have you ever considered switching skills?"
1665
+ end
1666
+ elsif decision == "weather"
1667
+ if probability >= 1.7741802839285145e-10
1668
+ puts "#{bot_name}: The weather is #{decision}?"
1669
+ else
1670
+ puts "#{bot_name}: That weather doesn't seem likely."
1671
+ end
1672
+ else
1673
+ puts "#{bot_name}: I'm not sure what you mean."
2283
1674
  end
1675
+
2284
1676
  end
2285
- end
2286
-
1677
+
1678
+ end
2287
1679
  end
1680
+
2288
1681
  end