---
name: "Megahal"
section: "3pm"
platform: "linux"
package: "megahal"
version: "9.1.1a-9"
release: "Debian 6.0 (Squeeze)"
platforms: ["linux"]
url: "https://new.carta.tech/Megahal"
---

# Megahal(3pm)

Perl extension for the Megahal conversation simulator library.

## NAME

Megahal - Perl extension for the Megahal conversation simulator library.

## SYNOPSIS

```
  use Megahal;
  Megahal::megahal_initialize();
  Megahal::megahal_do_reply(texte, log);
  Megahal::megahal_learn_no_reply(texte, log);
  Megahal::megahal_cleanup();
```

## ABSTRACT

```
  Megahal is a conversation simulator that learns as you talk to it.
  It uses a Markov Model to learn how to hold a conversation. It is
  possible to teach Meagahal to talk about new topics, and in
  different languages.
```

## DESCRIPTION

- *megahal\_initialize()*

  Initialize megahal brain. Required before other functions are called.

- megahal\_do\_reply(text, log)

  Update the brain by feeding him the input **text**. Logging is controlled via the **log** boolean. Returns the answer of the bot.

- *megahal\_learn\_no\_reply()*

  Same as above but without making a reply. Much faster and typically used in scripts for quick learning.

- *megahal\_cleanup()*

  You need to call this function to save the brain, and finish Megahal.

## FILES

Megahal looks for the following files in the current directory:

- megahal.brn

  Megahal brain.

- megahal.ban

  List of words which cannot be used as keywords.

- megahal.log

  Log file for errors.

- megahal.txt

  Log file for the conversation.

- megahal.swp

  Keyword translation for Megahal. If Megahal choose "why" as keyword and find a line containing "why because" in a line of this file then "why" gets translated in "because" in the reply.

## SEE ALSO

http://megahal.sourceforge.net/

## AUTHOR

This page was written by Laurent Fousse, \<laurent@komite.net\>.

## COPYRIGHT AND LICENSE

Copyright 2003 by Jason Hutchens, David N. Welton and others.

This library is free software; you can redistribute it and/or modify it under the GNU General Public Licence.

## POD ERRORS

Hey! **The above document had some coding errors, which are explained below:**

- Around line 138:

  You forgot a '=back' before '=head1'
