def main(_):
    logger = logging.getLogger()
    logger.setLevel(logging.INFO)

    parser = argparse.ArgumentParser(description='Conversation Generator')
    parser.add_argument('--out', metavar='conversationPath', dest='filepath', required=True)
    parser.add_argument('--size', metavar='numMessages', type=int, dest='numMsgs', required=True,
                        help="number of messages to generate for the conversation")
    parser.add_argument('--minWords', metavar='minWords', type=int, dest='minWords', default=1,
                        help="minimum number of words per message")
    parser.add_argument('--maxWords', metavar='maxWords', type=int, dest='maxWords', default=20,
                        help="maximum number of words per message")
    parser.add_argument('--startDate', metavar='startDate', dest='startDate', required=True,
                        help="earliest possible date for first generated message")
    parser.add_argument('--endDate', metavar='endDate', dest='endDate', required=True,
                        help="latest possible date of last generated message")
    parser.add_argument('--authors', metavar='authors', dest='authors', type=list,
                        default=["s1", "s2"],
                        help=""" list of senders' aliases""")

    args = parser.parse_args()
    filepath = args.filepath
    numMsgs = args.numMsgs
    startDate = args.startDate
    endDate = args.endDate
    minWords = args.minWords
    maxWords = args.maxWords
    authors = args.authors
    conv = generateNewConversation(numMsgs, startDate, endDate, authors, minWords, maxWords)
    mio.printListToFile(conv, filepath)
Пример #2
0
def main(_):
    logger = logging.getLogger()
    logger.setLevel(logging.INFO)

    parser = argparse.ArgumentParser(description='Conversation Generator')
    parser.add_argument('--out',
                        metavar='conversationPath',
                        dest='filepath',
                        required=True)
    parser.add_argument(
        '--size',
        metavar='numMessages',
        type=int,
        dest='numMsgs',
        required=True,
        help="number of messages to generate for the conversation")
    parser.add_argument('--minWords',
                        metavar='minWords',
                        type=int,
                        dest='minWords',
                        default=1,
                        help="minimum number of words per message")
    parser.add_argument('--maxWords',
                        metavar='maxWords',
                        type=int,
                        dest='maxWords',
                        default=20,
                        help="maximum number of words per message")
    parser.add_argument(
        '--startDate',
        metavar='startDate',
        dest='startDate',
        required=True,
        help="earliest possible date for first generated message")
    parser.add_argument('--endDate',
                        metavar='endDate',
                        dest='endDate',
                        required=True,
                        help="latest possible date of last generated message")
    parser.add_argument('--authors',
                        metavar='authors',
                        dest='authors',
                        type=list,
                        default=["s1", "s2"],
                        help=""" list of senders' aliases""")

    args = parser.parse_args()
    filepath = args.filepath
    numMsgs = args.numMsgs
    startDate = args.startDate
    endDate = args.endDate
    minWords = args.minWords
    maxWords = args.maxWords
    authors = args.authors
    conv = generateNewConversation(numMsgs, startDate, endDate, authors,
                                   minWords, maxWords)
    mio.printListToFile(conv, filepath)
Пример #3
0
def testConversationGenerator():
    conv = conversationGenerator.generateNewConversation(100, "2014.01.30 06:01:57", "2014.12.30 06:01:57", ["s1", "s2"], 3, 20)
    mio.printListToFile(conv, os.path.join(mio.getResourcesPath(), "test.txt"))
Пример #4
0
def testConversationGenerator():
    conv = conversationGenerator.generateNewConversation(
        100, "2014.01.30 06:01:57", "2014.12.30 06:01:57", ["s1", "s2"], 3, 20)
    mio.printListToFile(conv, os.path.join(mio.getResourcesPath(), "test.txt"))