/*
 * Aunts and Butlers
 *
 * Vocabulary
 *
 */

Synonyms = new Object;
NUM_SYNS = 0;

function words(string)
{
	if(string.indexOf('.')==-1)  // er... I have no idea why this should be
		string += '.' + string;  // necessary, but nothing works without it!
	
	Synonyms[++NUM_SYNS] = string.substring(0,string.indexOf('.')) +
	  '.' + string + '.';
}

// All recognised words, and their synonyms
// Names of persons, places and things need not be listed here,
// unless they have synonyms

// directions come first...
words('north.n.northern.northland');
  // note that 'the north' is a special concept in this particular game,
  // so we have to be a bit funny.
words('northeast.north-east.ne');
words('northwest.north-west.nw');
words('south.s');
words('southeast.south-east.se');
words('southwest.south-west.sw');
words('east.e');
words('west.w');
words('down.d.descend.downward.downstair.fall');
words('up.u.ascend.upstair.upward.climb.upstair');
words('out.exit.exeunt.outward.outside');
words('in.enter.inward.inside');
// ...so that we can do this
DIRECTIONS='';
for(var i=1;i<=NUM_SYNS;++i)
	DIRECTIONS+=Synonyms[i];

// words of more than three letters to ignore
WORDS_TO_IGNORE = 'about.with.around.under.over.go.do.last.section';

// all other words come now.
words('dir');
words('it.them');
words('him.her');
words('help');
words('score.points');
words('inventory.inv.invent.i.list.carrying.stuff.possession');
words('game');
words('restart.restart');
words('save');
words('load.restore');
words('delete');
words('transcript');
words('verbose.unterse');
words('terse.unverbose');
words('undo');
words('xyzzy.plugh');

words('through.thru');

words('card.visiting.visiting-card');
words('gloves.glove.gauntlet.mitten');
words('jerkin.waistcoat.tunic.waist-coat.natty');
words('collar.trilatinum.splorex.trilatinum-splorex');
words('wait.z');
words('take.hold.get.pick.grab.catch');
words('all.everything');
words('drop.put');
words('talk.tell.chat.ask.speak.say.question');
words('give.show.present.bequeath.offer.proffer');
words('throw.chuck.fling');
words('wake.awake.awaken');
words('look.l.x.lookat.lookit.looky.examine.exam.see.view.read.peruse.search.watch.describe');
words('listen.hear');
words('fight.hit.kill.smite.punch.kick.stab.attack.batter.bash.waste.pagger');
words('wear.puton.don');
words('remove.takeoff.unwear.doff.disrobe');
words('on.onto');
words('off');
words('push.press');
words('button.switch');
words('teleporter.teleportation.transporter');
words('empty.pour.spill');
words('kiss.snog.smooch');
words('sing.hum.whistle');
words('fill');
words('squeak.squeeze');
words('turn.spin.rotate.twist');

words('shakespeare.william.bard');
words('shack.hut.tavern');
words('desert.sand');
words('wagon.cart.caravan.waggon.canopied');
words('stage');
words('machine.machinery.drive.stardrive.complex.warpdrive.engine.loom.babbage');
words('dial.thermostat.heat');
words('typewriter.keyboard.computer');
words('type.typewrite');
words('portrait.poster.picture.painting');
words('water.rain.dishwater.drip.leak.dripping.rainwater');
words('hole.gap');
words('table.desk');
words('start.begin');
words('bed.mattress');
words('door.doorway');
words('knock.knock');
words('gate.gateway');
words('open.unlock');
words('close.shut');
words('window');
words('stairs.stair.staircase.steps');
words('sit');
words('stand');
words('sleep');
words('eat.munch.chew.swallow');
words('drink.quaff.swig');
words('jump.leap');
words('move.push');
words('couch.sofa');
words('smell.sniff.inhale.breathe');
words('buy.purchase');
words('wave.shake.rattle.ring');
words('wall');
words('ground.floor');
words('ceiling.roof.slate');
words('nose');
words('blow');
words('shout.scream.yell.holler.bellow');
words('sneeze');
words('answer');
words('phone.telephone.receiver');
words('corpse.body.dead');
words('call');
words('mirror.reflection.reflective.reflect');
words('panel.paneling.panelling');
words('circle.black');
words('sign.post.signpost.signboard.notice.plaque');
words('hedge.hedgerow.plant.greenery.leaf.leaves');
words('divide.line.dotted.dots');
words('break.smash.destroy.crash.rip.tear');
words('clean.wash.tidy');
words('touch');
words('password.parseword');
words('railway.railroad.rail.track');
words('crowd.mayhem.cook.gardener.maid.spectator')
words('fog.mist.smog')
words('swear.bastard.' + rot13('shpx.shpxvat.sneg.phag.nefr.pbpx.jnax.fuvg.fuvgr.funt.obyybpxf'));
words('robin.johnson.robinjohnson');

words('amphora.amphorae.jar');
words('hieroglyphic.pattern.hieroglyph');
words('organ.kidney.liver.intestine.lung.heart');
words('sarcophagus.sarcophagi.tomb.coffin');
words('spit.gob');
words('spittoon.spitoon');
words('wheel.mill-wheel.millwheel.spoke');
words('stovepipe.stove.pipe.chimney.chimneypot.chimney-pot');
words('box.lost.property.lostproperty');
words('paperwork.work.paper');
words('play.practise.practice');
words('learn');
words('piano.grand.pianoforte.grandpiano.pianny.pianola');
words('armchair.chair.seat.wingback');
words('pigeon.carrier.carrierpigeon.bird.birdie.birdy');
words('cricket');
words('horse.cart');
words('clutter.mess');
words('clean.wash');
words('self.me.you.myself.yourself.ampersand.fodge');
words('cedilla.aunt.auntie.aunty.ladyship');
words('butler.valet.servant.jeeves.manservant.servingman');
words('alf.alfred.alfie.alfy.alphonse.northerner.peasant');
words('virgule.cousin.american.yank.yankee.virgil.virg');
words('plank.sergeant.sarge.sargent.copper.cop.police.policeman.bobby.polisman.bill.flatfoot.bluebottle.gendarme');
words('fatty.commander.scotty.engineer.fatso.spaceman');
words('typist.clerk.worker');
words('trunk.lid.chest');
words('gladstone.dog.poodle');
words('glasses.spectacles.pincenez.pince.nez');
words('england.britain.albion.uk.rightpondia.british.brit.english.limey');
words('america.usa.leftpondia.colonies.states');
words('name.surname.forename');
words('inheritance.inherit'); // hmmm, not 'will'
words('yes');
words('no');

// things
words('flower');
words('lance');
words('handkerchief.hanky.tissue');
words('cufflinks.cufflink.cuff-link.cuff.sapphire');
words('tie.necktie.neck-tie.woollen');
words('iou');
words('letter.love.loveletter');
words('half'); // becomes synonym for letter later
words('pheasant.bird.fowl.wildfowl.grouse');
words('teacup.tea.cup.mug.brew.char.cuppa');
words('coffee');
words('bottle.flask.sauce.dressing.vinegar.balsamic.vinaigrette.vinaigre');
words('bell.ringer.silver')
words('suitcase.case.bag');
words('tailcoat.tail.coat.tail-coat.frockcoat.frock-coat.frock.jacket');
words('ash.ashes.clump');
words('urn.vase.china');
words('bone.rubber.squeaky.toy');

words('shotgun.gun.firearm.rifle.blunderbuss.iron.shooting.shoot');
words('control');
words('hat.fedora.trilby');
words('food.dinner.supper');

words('haggis');
words('will.testament');

function rot13(txt)
{
	var rot_alpha = 'abcdefghijklmnopqrstuvwxyzabcdefghijklmABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLM';
	var op = '';
	for(var i=0;i<txt.length;++i)
	{
		var c = txt.charAt(i);
		if(rot_alpha.indexOf(c)!=-1)
			op += rot_alpha.charAt(rot_alpha.indexOf(c)+13)
		else
			op += c;
	}
	return(op);
}

