Warning: session_start(): open(/var/lib/php/sessions/sess_v2e2cfp3lp8ln1ls6g9dma80sq, O_RDWR) failed: No space left on device (28) in /var/www/tb-usercake/models/config.php on line 51
Warning: session_start(): Failed to read session data: files (path: /var/lib/php/sessions) in /var/www/tb-usercake/models/config.php on line 51
import javax.imageio.*;
import java.awt.image.*;
import java.awt.event.*;
import java.awt.*;
import java.security.NoSuchAlgorithmException;
import java.security.MessageDigest;
import java.lang.management.*;
import java.lang.ref.*;
import java.lang.reflect.*;
import java.net.*;
import java.io.*;
import javax.swing.table.*;
import javax.swing.text.*;
import javax.swing.event.*;
import javax.swing.*;
import java.util.concurrent.atomic.*;
import java.util.concurrent.*;
import java.util.regex.*;
import java.util.List;
import java.util.zip.*;
import java.util.*;
public class main {
static List rules = new ArrayList();
static List statements = new ArrayList();
public static void main(String[] args) throws Exception {
rules.add("\"$1 is the singular of $2.\" <=> \"$2 is the plural of $1.\"");
statements.add("house is the singular of houses.");
process();
print(fromLines(statements));
ask("how many plurals does \"house\" have?");
ask("what are the plurals of \"house\"?");
}
static void ask(String q) {
print("? " + q);
Map map = new TreeMap();
if (match4("how many plurals does $1 have?", q, map))
print(getPlurals(map.get("$1")).size());
else if (match4("what are the plurals of $1?", q, map))
print(structure(getPlurals(map.get("$1"))));
else
print("dunno.");
}
static List getPlurals(String x) {
String c = "$2 is the plural of " + x;
print("[" + c + "]");
MultiMap matches = matchAll(c);
return matches.get("$2");
}
// result of matchStatements ordered by variable
static MultiMap matchAll(String pat) {
MultiMap map = new MultiMap();
List