Generation of Themed Portable Crosswords A WordNet ... · PDF fileGeneration of Themed...

104
Generation of Themed Portable Crosswords A WordNet Implementation Aoife Aherne BA (Mod) CSLL Final Year Project 2005 Supervisor: Dr. Carl Vogel 15th April 2005

Transcript of Generation of Themed Portable Crosswords A WordNet ... · PDF fileGeneration of Themed...

Page 1: Generation of Themed Portable Crosswords A WordNet ... · PDF fileGeneration of Themed Portable Crosswords A WordNet Implementation ... not been submitted as an exercise for a degree

Generation of Themed PortableCrosswords

A WordNet Implementation

Aoife AherneBA (Mod) CSLL

Final Year Project 2005Supervisor: Dr. Carl Vogel

15th April 2005

Page 2: Generation of Themed Portable Crosswords A WordNet ... · PDF fileGeneration of Themed Portable Crosswords A WordNet Implementation ... not been submitted as an exercise for a degree

i

Declaration

I hereby declare that this thesis is entirely my own work and that it hasnot been submitted as an exercise for a degree at any other university.

April 15, 2005Aoife Aherne

Page 3: Generation of Themed Portable Crosswords A WordNet ... · PDF fileGeneration of Themed Portable Crosswords A WordNet Implementation ... not been submitted as an exercise for a degree

ii

Acknowledgements

Thank you to my classmates for four fun-filled years in CSLL, my parentsfor their considerable support and guidance and last but by no means least,my course director and project supervisor, Carl Vogel, for his direction and

infectious enthusiasm over the past four years.

Page 4: Generation of Themed Portable Crosswords A WordNet ... · PDF fileGeneration of Themed Portable Crosswords A WordNet Implementation ... not been submitted as an exercise for a degree

iii

Person on a bus doing a crossword:Can you think of two personal pronouns?

Innocent Bystander:Who, me?

Page 5: Generation of Themed Portable Crosswords A WordNet ... · PDF fileGeneration of Themed Portable Crosswords A WordNet Implementation ... not been submitted as an exercise for a degree

Contents

1 Introduction 81.1 Why Themed Crosswords? . . . . . . . . . . . . . . . . . . . . 81.2 Why Printable, Portable Crosswords? . . . . . . . . . . . . . . 10

2 Description of Graham 2003 112.1 Functionality . . . . . . . . . . . . . . . . . . . . . . . . . . . 112.2 Resources . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 112.3 Random Symmetric Grid Generation . . . . . . . . . . . . . . 112.4 Database Queries . . . . . . . . . . . . . . . . . . . . . . . . . 122.5 Finding a Word Set to Satisfy the Grid . . . . . . . . . . . . . 122.6 Communication Between Java and Prolog . . . . . . . . . . . 122.7 Communication Between Server and Applet . . . . . . . . . . 132.8 Constructive Criticism . . . . . . . . . . . . . . . . . . . . . . 13

3 Technical Difficulties 153.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . 153.2 Background . . . . . . . . . . . . . . . . . . . . . . . . . . . . 153.3 Memory Allocation Conflict . . . . . . . . . . . . . . . . . . . 163.4 The Linux Solution: Proposed by Developers of Prolog . . . . 173.5 The Windows Solution: Proposed by Developers of Prolog . . 173.6 Conclusion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18

4 Project Goals 194.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . 194.2 Printable Versions of Crosswords . . . . . . . . . . . . . . . . 19

4.2.1 Why Are Printable Versions Required? . . . . . . . . . 194.2.2 Proposed Implementation . . . . . . . . . . . . . . . . 19

4.3 Integration of WordNet . . . . . . . . . . . . . . . . . . . . . . 204.3.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . 204.3.2 Why Integrate WordNet? . . . . . . . . . . . . . . . . 204.3.3 Proposed Implementation . . . . . . . . . . . . . . . . 20

1

Page 6: Generation of Themed Portable Crosswords A WordNet ... · PDF fileGeneration of Themed Portable Crosswords A WordNet Implementation ... not been submitted as an exercise for a degree

CONTENTS 2

4.3.4 Why a MySQL version of WordNet2? . . . . . . . . . . 214.4 Restriction of Database Access . . . . . . . . . . . . . . . . . . 22

4.4.1 Why Restrict Database Access? . . . . . . . . . . . . . 224.4.2 Proposed Implementation . . . . . . . . . . . . . . . . 22

4.5 Conclusion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22

5 WordNet - A Lexical Resource 245.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . 245.2 What is WordNet? . . . . . . . . . . . . . . . . . . . . . . . . 245.3 WordNet Statistics . . . . . . . . . . . . . . . . . . . . . . . . 255.4 Structural Aspects of WordNet . . . . . . . . . . . . . . . . . 25

5.4.1 Synset . . . . . . . . . . . . . . . . . . . . . . . . . . . 255.4.2 Organisation of the WordNet Hierarchy . . . . . . . . . 27

5.5 Limitations of WordNet . . . . . . . . . . . . . . . . . . . . . 285.6 Existing WordNet Driven Applications . . . . . . . . . . . . . 295.7 Conclusion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30

6 Integrating WordNet 316.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . 316.2 Software Required . . . . . . . . . . . . . . . . . . . . . . . . . 316.3 Basic Algorithm . . . . . . . . . . . . . . . . . . . . . . . . . . 326.4 Algorithm Explained . . . . . . . . . . . . . . . . . . . . . . . 32

6.4.1 An Iterative Problem . . . . . . . . . . . . . . . . . . . 336.4.2 The Magic Number 5 . . . . . . . . . . . . . . . . . . . 33

6.5 Installation of the WordNet2 Database . . . . . . . . . . . . . 346.6 Adaptation of WordNet2 Database . . . . . . . . . . . . . . . 346.7 Interfacing WordNet2 MySQL Database & Java . . . . . . . . 36

6.7.1 Java Data Structures Developed . . . . . . . . . . . . . 366.7.2 Connecting to the Database . . . . . . . . . . . . . . . 376.7.3 Retrieving the Words . . . . . . . . . . . . . . . . . . . 386.7.4 Retrieving the Definitions . . . . . . . . . . . . . . . . 396.7.5 Removing Multiple Forms of Solution From A Clue . . 41

6.8 Grid Generation . . . . . . . . . . . . . . . . . . . . . . . . . . 426.8.1 Quality versus Quantity . . . . . . . . . . . . . . . . . 42

6.9 Independent Analysis of Themed Crosswords . . . . . . . . . . 456.9.1 Interpretation Of Responses . . . . . . . . . . . . . . . 466.9.2 Results . . . . . . . . . . . . . . . . . . . . . . . . . . . 466.9.3 Discussion of Results . . . . . . . . . . . . . . . . . . . 47

6.10 Conclusion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48

Page 7: Generation of Themed Portable Crosswords A WordNet ... · PDF fileGeneration of Themed Portable Crosswords A WordNet Implementation ... not been submitted as an exercise for a degree

CONTENTS 3

7 Integration of the Printing Interface 497.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . 497.2 Tools Required . . . . . . . . . . . . . . . . . . . . . . . . . . 49

7.2.1 LATEX . . . . . . . . . . . . . . . . . . . . . . . . . . . 497.2.2 Source . . . . . . . . . . . . . . . . . . . . . . . . . . . 497.2.3 Features . . . . . . . . . . . . . . . . . . . . . . . . . . 507.2.4 Packages . . . . . . . . . . . . . . . . . . . . . . . . . . 507.2.5 crosswrd.sty . . . . . . . . . . . . . . . . . . . . . . . . 517.2.6 Structure of the .tex file . . . . . . . . . . . . . . . . . 51

7.3 Conversion of TEXFile to PDF File . . . . . . . . . . . . . . . 527.4 Integrating the production of PDF files with the current system 53

7.4.1 Stage One - User Interaction . . . . . . . . . . . . . . . 537.4.2 Stage Two - Production of .tex file . . . . . . . . . . . 537.4.3 Stage Three - Production of DVI and PDF files . . . . 547.4.4 Stage Four - Making the PDF File Available to the User. 56

7.5 Sample Output . . . . . . . . . . . . . . . . . . . . . . . . . . 577.5.1 Solution . . . . . . . . . . . . . . . . . . . . . . . . . . 577.5.2 Blank . . . . . . . . . . . . . . . . . . . . . . . . . . . 58

7.6 Problems Encountered . . . . . . . . . . . . . . . . . . . . . . 597.7 Conclusion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59

8 Restricting Database Access 608.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . 608.2 Implementation . . . . . . . . . . . . . . . . . . . . . . . . . . 608.3 Basic Algorithm . . . . . . . . . . . . . . . . . . . . . . . . . . 608.4 Changes to the Database . . . . . . . . . . . . . . . . . . . . . 608.5 Changes Made to the MultiServerThread Class . . . . . . . . . 618.6 The isValidPassword Method . . . . . . . . . . . . . . . . . . 628.7 Adapting the Applet . . . . . . . . . . . . . . . . . . . . . . . 638.8 Conclusion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63

9 Provision of user Help File 649.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . 649.2 Help File Contents . . . . . . . . . . . . . . . . . . . . . . . . 649.3 Making Help File Available to the User . . . . . . . . . . . . . 659.4 Conclusion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65

10 Conclusion 6610.1 Further Study . . . . . . . . . . . . . . . . . . . . . . . . . . . 6610.2 Concluding Remarks . . . . . . . . . . . . . . . . . . . . . . . 67

Page 8: Generation of Themed Portable Crosswords A WordNet ... · PDF fileGeneration of Themed Portable Crosswords A WordNet Implementation ... not been submitted as an exercise for a degree

Bibliography 68

A Screen Shots 69

B Evaluated Crosswords 73

C 5 Themed Crosswords: Blank 81

D 5 Themed Crosswords: Solution 86

E Developer & Installation Guide 91E.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . 91E.2 Packages - Installation & Configuration . . . . . . . . . . . . . 91

E.2.1 EasyPHP . . . . . . . . . . . . . . . . . . . . . . . . . 91E.2.2 Java . . . . . . . . . . . . . . . . . . . . . . . . . . . . 92E.2.3 SICStus Prolog . . . . . . . . . . . . . . . . . . . . . . 92E.2.4 Adobe Reader 5 . . . . . . . . . . . . . . . . . . . . . . 93E.2.5 LATEX . . . . . . . . . . . . . . . . . . . . . . . . . . . 93

E.3 Setting of Classpaths . . . . . . . . . . . . . . . . . . . . . . . 94

F User Help File 95F.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . 95F.2 Crossword Generation . . . . . . . . . . . . . . . . . . . . . . 96

F.2.1 WordNet2 . . . . . . . . . . . . . . . . . . . . . . . . . 96F.2.2 Websters Unabridged Dictionary . . . . . . . . . . . . 96F.2.3 User Database . . . . . . . . . . . . . . . . . . . . . . . 97

F.3 Uploading Databases . . . . . . . . . . . . . . . . . . . . . . . 98F.3.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . 98F.3.2 Text File Format . . . . . . . . . . . . . . . . . . . . . 98F.3.3 Database Format . . . . . . . . . . . . . . . . . . . . . 98

F.4 Changing Passwords . . . . . . . . . . . . . . . . . . . . . . . 99F.4.1 How to? . . . . . . . . . . . . . . . . . . . . . . . . . . 99

F.5 Creating Printable Versions of Crosswords . . . . . . . . . . . 100F.5.1 Viewing Crosswords . . . . . . . . . . . . . . . . . . . 100

Page 9: Generation of Themed Portable Crosswords A WordNet ... · PDF fileGeneration of Themed Portable Crosswords A WordNet Implementation ... not been submitted as an exercise for a degree

List of Figures

1.1 New York Time’s Themed Crossword . . . . . . . . . . . . . . 9

3.1 Java Virtual Machine Error Message . . . . . . . . . . . . . . 16

4.1 Hyponym & Hypernym Examples . . . . . . . . . . . . . . . . 214.2 System Structure & Data-flow . . . . . . . . . . . . . . . . . . 23

6.1 Wn synset Prolog File Strucutre . . . . . . . . . . . . . . . . . 346.2 Adaptation of Prolog File . . . . . . . . . . . . . . . . . . . . 356.3 Word Retrieval . . . . . . . . . . . . . . . . . . . . . . . . . . 376.4 SQL Hypernym Query . . . . . . . . . . . . . . . . . . . . . . 396.5 Definition Retrieval . . . . . . . . . . . . . . . . . . . . . . . . 406.6 Grid Containing 1 & 2 Letter Words . . . . . . . . . . . . . . 436.7 Grid Free of 1 & 2 Letter Words . . . . . . . . . . . . . . . . . 44

7.1 TEX File 1st Section . . . . . . . . . . . . . . . . . . . . . . . 527.2 TEX File 3rd Section . . . . . . . . . . . . . . . . . . . . . . . 527.3 TEX File Clue Section . . . . . . . . . . . . . . . . . . . . . . 527.4 Java String Representation of TEX Clue Section . . . . . . . . 557.5 DVI and PDF Production . . . . . . . . . . . . . . . . . . . . 557.6 Solution Crossword . . . . . . . . . . . . . . . . . . . . . . . . 577.7 Blank Crossword . . . . . . . . . . . . . . . . . . . . . . . . . 58

8.1 PASSWORD method in MultiServerThread . . . . . . . . . . 628.2 isValidPassword method in DatabaseConnection class . . . . . 628.3 Display of Password Dialogue . . . . . . . . . . . . . . . . . . 63

A.1 Introductory Screen . . . . . . . . . . . . . . . . . . . . . . . . 69A.2 A Completed Crossword . . . . . . . . . . . . . . . . . . . . . 70A.3 Creating PDF File . . . . . . . . . . . . . . . . . . . . . . . . 71A.4 Uploading to Database . . . . . . . . . . . . . . . . . . . . . . 72

5

Page 10: Generation of Themed Portable Crosswords A WordNet ... · PDF fileGeneration of Themed Portable Crosswords A WordNet Implementation ... not been submitted as an exercise for a degree

List of Tables

5.1 WordNet Statistics . . . . . . . . . . . . . . . . . . . . . . . . 255.2 WordNet Results for ”sport” . . . . . . . . . . . . . . . . . . . 26

6.1 Crossword Evaluation Results . . . . . . . . . . . . . . . . . . 47

6

Page 11: Generation of Themed Portable Crosswords A WordNet ... · PDF fileGeneration of Themed Portable Crosswords A WordNet Implementation ... not been submitted as an exercise for a degree

Abstract

This report presents a computer program, developed as a language learningtool, that produces at random, crosswords based on a particular user

stipulated theme. The crossword generator algorithm exploits a WordNet2MySQL database to extract thematically related words and integrates a

LATEX printing interface to facilitate the printing of the crosswordsproduced.

Page 12: Generation of Themed Portable Crosswords A WordNet ... · PDF fileGeneration of Themed Portable Crosswords A WordNet Implementation ... not been submitted as an exercise for a degree

Chapter 1

Introduction

The content of this report describes how the piece of software responsiblefor the generation of themed portable crosswords came into being. Technicalinformation and background information is provided on WordNet and LATEX,two resources that are central to the projects implementation. Technicaldifficulties encountered are documented and attention is also paid to theapplication’s role in a real world language-learning environment. Ideas forfuture extensions to the application are elaborated upon.

1.1 Why Themed Crosswords?

The aim of the program is to accomplish by means of a computer programthat which is currently achieved manually by those involved in the prepa-ration of the New York Time’s themed crossword. An example of such acrossword is provided in Figure 1.1. Note that the “long” solutions are re-lated to the theme indicated. Other solutions are not related to the theme.

Secondly, the acquisition of vocabulary by second language learners oftenadopts a themed approach, whereby vocabulary about a particular topic ispresented to the learner. This can be viewed, for example, on the follow-ing website dedicated to second language learners of the French language:www.realfrench.net. In this instance, the site proposes a total of 59 cross-words, based on specific predetermined themes. These crosswords are com-piled by hand. Ideally, a computer could accomplish this task. It is the aimof the program described in this report to achieve exactly that.

8

Page 13: Generation of Themed Portable Crosswords A WordNet ... · PDF fileGeneration of Themed Portable Crosswords A WordNet Implementation ... not been submitted as an exercise for a degree

CHAPTER 1. INTRODUCTION 9

Figure 1.1: New York Time’s Themed Crossword

Page 14: Generation of Themed Portable Crosswords A WordNet ... · PDF fileGeneration of Themed Portable Crosswords A WordNet Implementation ... not been submitted as an exercise for a degree

CHAPTER 1. INTRODUCTION 10

1.2 Why Printable, Portable Crosswords?

Convenience is the word of choice. Should this program be employed as alanguage learning tool it is necessary to have a printing interface available tothe primary user (in this case the lecturer/teacher). This allows the distrib-ution of a hard copy to each student - 30 computers would not be necessary.Furthermore, even if computer resources were unrestrained, given that thecrosswords are produced at random, for any given theme entered multiplecrosswords will be produced - hence a hard distributable copy is required -ideally with an option of printing the crossword with or without it’s solutiondisplayed.

Furthermore, not only can crosswords be printed, they can also be savedto the user’s system, providing them with a virtual “soft-copy” that theymay consult repeatedly.

Page 15: Generation of Themed Portable Crosswords A WordNet ... · PDF fileGeneration of Themed Portable Crosswords A WordNet Implementation ... not been submitted as an exercise for a degree

Chapter 2

Description of Graham 2003

2.1 Functionality

User interaction with the program is controlled via a web user interface, writ-ten in HTML and containing a Java applet that displays the user instructions,options and eventually the crossword puzzle itself.

2.2 Resources

The database exploited by Graham is “Webster’s Unabridged Dictionary”.This electronic dictionary is very dated and is lacking in modern day wordsand expressions. Dictionary information is recorded in a MySQL database,stored on macneill, a college server and using a JDBC driver is queriedthrough the implementation of methods inherited from the Java.sql package.In addition to Websters Unabridged Dictionary the user may also uploadtheir own dictionary in text file format containing a word and it’s respectivedefinition on the following line.

2.3 Random Symmetric Grid Generation

This aspect of the project was implemented entirely in Java and functionsimpressively. The user stipulates the grid size and level of difficulty desired.These parameters determine the nature of the gird generated, with the levelof difficulty determining the ratio of black to white squares in the grid. TheWordSpace data structure developed by Graham encodes word lengths re-quired by the grid and their position in the grid.

Page 16: Generation of Themed Portable Crosswords A WordNet ... · PDF fileGeneration of Themed Portable Crosswords A WordNet Implementation ... not been submitted as an exercise for a degree

CHAPTER 2. DESCRIPTION OF GRAHAM 2003 12

2.4 Database Queries

Only words of a specific length are sought from the database. A “theme”search algorithm is employed such that all words in the dictionary that con-tain the target theme word in their definition or as head words are selected.Clues of the words included in the grid’s solution set are retrieved fromthe database separately. Several Java classes were developed by Grahamto represent information relating to the solution set and characteristics ofthe words retrieved from the database. These include the WordData andSolution classes.

2.5 Finding a Word Set to Satisfy the Grid

Prolog, due to its theorem proving capabilities, was deemed a suitable toolfor this task. Attention was paid to the approach described in Berghel andYI (1989) for solving crossword puzzles, reducing the search space and theavoidance of naive backtracking by ordering the word slots and eliminatingat an early stage words that are unlikely to fit into the grid. Similarly,when a word poses a problem - all of its inter-linking words are removed andre-assessed without the program needlessly backtracking through all of thesolutions found thus far.

2.6 Communication Between Java and Pro-

log

The jasper package, a member of the Java class hierarchy controls commu-nication between the principal application, written in Java and the ancillaryProlog application used to find a solution set of words for the grid generated.Firstly, Java writes a Prolog file “crossword.pl” containing the words in a for-mat that can be interpreted by Prolog as well a linear encoding of the wordslots and relationships between same. A SICStus Prolog object is initiatedwhich in turn calls the newly generated Prolog file and a Prolog predicatefile “functions.pl” that contains the necessary Prolog code for interrogating“crossword.pl”. Should the Prolog compiler succeed in generating a solu-tion set this is communicated via the SICStus object to Java which in turnqueries the database for the definitions associated with the words selectedfor the grid before communicating everything to the Java applet for displayon screen.

Page 17: Generation of Themed Portable Crosswords A WordNet ... · PDF fileGeneration of Themed Portable Crosswords A WordNet Implementation ... not been submitted as an exercise for a degree

CHAPTER 2. DESCRIPTION OF GRAHAM 2003 13

2.7 Communication Between Server and Ap-

plet

Communication between applet and server and hence user and program is fa-cilitated by MultiServer and MultiServerThread, Java classes inherited fromthe Java library and exploited by Graham to initiate crossword generationand database interrogation.

2.8 Constructive Criticism

The project is very well coded and presented. The user interface providedis more than adequate. Information pertinent to crossword generation andcrossword solving are intuitive and easy-to-use. However, more explicit in-struction could be provided particularly if this tool was to be used in aclassroom environment, as suggested by Graham. This is particularly true ofinformation relating to the option of the user supplying their own databasein textfile format.

Secondly, on a more practical issue, users cannot ever retrieve or savea copy of the crossword to complete at a later date — they are obliged tofinish the crossword in one sitting. An ideal solution to this problem wouldbe the automatic generation of printable versions of the crossword at theusers request. In a classroom environment this would be particularly useful,allowing an entire class to work on a specific crossword.

Thirdly, in Graham (2003) the solution to the clue very often appears inthe clue text. Graham removes exact occurences of the solution using theremoveAnswerFromClue() method in the Solution class, but has not dealtwith the solution in it’s plural, past particible or present particible forms.

A security issue, again, with respect to potential use as a language learn-ing tool in a classroom environment is raised with access to the database.Graham did not restrict database access. Access must be restricted such thatonly those with sufficent privileges (e.g.”root” /”teacher”) may add/modifydatabases on the system. Those with insufficent privileges (e.g ”student”)should only be able to generate and solve crossword puzzles.

Graham made exceptional advances in improving the execution time ofthe program through modification of the Prolog code. Despite the provisionof a viable algorithm, the crosswords produced are very loosely related and

Page 18: Generation of Themed Portable Crosswords A WordNet ... · PDF fileGeneration of Themed Portable Crosswords A WordNet Implementation ... not been submitted as an exercise for a degree

CHAPTER 2. DESCRIPTION OF GRAHAM 2003 14

at times totally unrelated to the theme specified. The fault does not liewithin the algorithm employed, it lies with the dictionary database it exploits.Due to the nature of the dictionary it was necessary, in order that enoughwords be returned to create a crossword, to select all words and definitionswithin which the string representation of the target word could be found.Hence, given the theme ”sport”, words like ”transport” and indeed cluescontaining ”transport” would be selected. Similarly the target theme ”cat”returns words and clues containing the substring ”cat”. Dictionary size alsocontributes greatly to the overall result. The incorporation of a WordNetdatabase, a lexical resource more similar to a thesaurus than to a standarddictionary, would go a long way towards solving this problem. Characteristicsof WordNet are described in Chapters 5 and 6.

Page 19: Generation of Themed Portable Crosswords A WordNet ... · PDF fileGeneration of Themed Portable Crosswords A WordNet Implementation ... not been submitted as an exercise for a degree

Chapter 3

Technical Difficulties

3.1 Introduction

The aim of this section is to outline the technical difficulties encounteredwhen attempting to install and run Graham (2003) on Linux systems, asdescribed in that report. Although a definite solution is not found, informa-tion here should be of use to anyone wishing to extend this project furtheror indeed attempt to resolve the platform incompatibility problem currentlyexperienced. Technical specifications detailed in this section were sourcedfrom Sun (2005) and SICStus (2004).

3.2 Background

The Java Virtual Machine, is an abstract computing machine that is a centralcomponent of the Java platform. Its role is to manipulate system memoryusing its instruction set. The JVM is in this sense independent of the hostoperating system.

Jasper is the linking package between Java and SICStus Prolog, allowingthe creation of SICStus objects and their processing by SICStus Prolog, in-dependently of the Java application. The SICStus Prolog runtime requiresmemory space in the lower 256MB of the address range. SICStus objects willnot initialise if insufficient memory is available in this location. Furthermore,methods cannot be invoked on already initialised SICStus objects if there isnot enough memory available to carry out the task.

Page 20: Generation of Themed Portable Crosswords A WordNet ... · PDF fileGeneration of Themed Portable Crosswords A WordNet Implementation ... not been submitted as an exercise for a degree

CHAPTER 3. TECHNICAL DIFFICULTIES 16

3.3 Memory Allocation Conflict

Errors were produced when the application attempted to invoke the Loadmethod on an existing SICStus object. The program aborted, with the JVMproducing a log file detailing the threads, or method sequences, that led toabort and the current level of memory usage within the JVM. An exampleof such an outburst is included in Figure 3.1.

An unexpected exception has been detected in native code outside the VM.Unexpected Signal : 11 occurred at PC=0x40614C5AFunction=Java se sics jasper SICStus spLoad+0x2ALibrary=/usr/local/stow/sicstus-3.11.2/lib/libspnative.so

Current Java thread:at se.sics.jasper.SICStus.spLoad(Native Method)at se.sics.jasper.SICStus.load(SICStus.Java:940)- locked <0x44c79b70> (a se.sics.jasper.SICStus)at CallP.fillGrid(CallP.Java:46)at MultiServerThread.run(MultiServerThread.Java:240)

Heap at VM Abort:Heapdef new generation total 576K, used 335K [0x44780000, 0x44820000,0x44c60000)eden space 512K, 53% used [0x44780000, 0x447c4000, 0x44800000)from space 64K, 99% used [0x44800000, 0x4480fff8, 0x44810000)to space 64K, 0% used [0x44810000, 0x44810000, 0x44820000)tenured generation total 1408K, used 510K [0x44c60000, 0x44dc0000,0x48780000)the space 1408K, 36% used [0x44c60000, 0x44cdf858, 0x44cdfa00, 0x44dc0000)compacting perm gen total 4096K, used 2106K [0x48780000, 0x48b80000,0x4c780000)the space 4096K, 51% used [0x48780000, 0x4898ea98, 0x4898ec00,0x48b80000)

Figure 3.1: Java Virtual Machine Error Message

As can be seen in the above error, the “from space” which forms partof the Eden space is full to 99% of capacity. The Eden Space is primarily

Page 21: Generation of Themed Portable Crosswords A WordNet ... · PDF fileGeneration of Themed Portable Crosswords A WordNet Implementation ... not been submitted as an exercise for a degree

CHAPTER 3. TECHNICAL DIFFICULTIES 17

used for the storing of “new” objects. In this instance, insufficient memorywould appear to be available. The error “name” Unexpected Signal 11 wouldappear to be causing a lot of people problems, given the number of internetforums dedicated to this yet unresolved issue.

3.4 The Linux Solution: Proposed by Devel-

opers of Prolog

SICStus would appear to be aware of this problem and had reportedly fixedthe bug from version 3.10 onwards. The application was running on SICStus3.11. SICStus proposed a temporary solution which involved the executionof a perl script to dedicate 256MB of space to SICStus in the lower addressrange simply by typing:

- spld –more-memory

Despite numerous attempts and correspondence with system’s adminis-trators this attempt was unsuccessful.

3.5 The Windows Solution: Proposed by De-

velopers of Prolog

This problem is not restricted to Linux. SICStus experiences similar prob-lems with the JVM on Windows machines. However, this can be overcomeby “re-basing” the JVM on the Windows machine. “Re-basing” increasesthe size of the initial JVM heap to such a great extent that it will not fit inthe lower address range and will hence leave this section of memory availableto SICStus. SICStus proposed this solution and it is available for viewing at

www.sics.se/ perm/sicstus/rebase jvm.html

This solution works! Given the heart-ache experienced and the startlinglack of crosswords produced it was decided to run with implementing theproject on a laptop running Windows XP. Following the installation of allnecessary packages and the configuration of classpaths the application ransmoothly and crosswords were generated. See Appendix E for details on howto successfully configure classpaths and install all relevant packages.

Page 22: Generation of Themed Portable Crosswords A WordNet ... · PDF fileGeneration of Themed Portable Crosswords A WordNet Implementation ... not been submitted as an exercise for a degree

CHAPTER 3. TECHNICAL DIFFICULTIES 18

3.6 Conclusion

The problems posed by the Linux/Java Virtual Machine/SICStus memoryallocation conflict proved excessively time consuming. Despite numerouscommunications with SICStus themselves no solution was found. There wasno choice but to go ahead with the implementation of the project on a lap-top running Windows. This worked impressively. In the future, SICStus,Linux, Java or indeed another individual may come up with a workable solu-tion that will render this kind of multi-language application compatible withboth Windows and Linux platforms.

In conclusion, the problems encountered, despite their obvious annoyance,provided me with a valuable insight into the workings of Linux, Windows,the JVM and SICStus that I would not have otherwise acquired.

Page 23: Generation of Themed Portable Crosswords A WordNet ... · PDF fileGeneration of Themed Portable Crosswords A WordNet Implementation ... not been submitted as an exercise for a degree

Chapter 4

Project Goals

4.1 Introduction

This section details the goals set out for my project, how it is proposed toimplement them and why a particular implementation was chosen. As statedin an earlier section, Graham(2003) is a very comprehensive program withfew limitations. There is however scope for improvement and the addition ofextensions to further enhance the crossword solving experience.

4.2 Printable Versions of Crosswords

4.2.1 Why Are Printable Versions Required?

Reasons for the inclusion of a printing interface are described in Section 1.2.In summary, printable versions are required for the following reasons:

• Convenience, in a Language Learning Environment

• Saving of crosswords for completion at a later stage

• Applet interactivity prevents printing of the webpage itself

4.2.2 Proposed Implementation

From the outset, the goal was to produce “portable document format” orPDF versions of the generated crosswords. The reason for this is threefold:

1. High quality output - professional look

Page 24: Generation of Themed Portable Crosswords A WordNet ... · PDF fileGeneration of Themed Portable Crosswords A WordNet Implementation ... not been submitted as an exercise for a degree

CHAPTER 4. PROJECT GOALS 20

2. Availability of LATEX, a document preparation system to create PDFfiles

3. Availability of a crossword “style file” within LATEX to facilitate theprinting of crosswords

4.3 Integration of WordNet

4.3.1 Introduction

Clearly, as described in Section 2.8, Graham did not succeed in producingthemed crosswords. The fault does not lie with the algorithm employed butwith the resource exploited. To this end, it was decided that in order tobest improve the situation a resource different to an electronic dictionarywas required.

4.3.2 Why Integrate WordNet?

WordNet is a semantic web whose structure mirrors current psycholinguisticmodels of how lexical information is stored in the human brain. This projectwas initiated and developed by the Cognitive Science Laboratory, Prince-ton University, New Jersey. The structure of WordNet is closer to that of athesaurus than to that of a traditional dictionary. Hence meaning searchesas opposed to word searches are carried out on WordNet. This allows theretrieval of words related to a particular theme.

Secondly, the source code for this linguistic tool is freely available. In ad-dition numerous other developers have made available a variety of interfacesto WordNet including a MySQL database version, generated from the Prologsource code. These projects can be sourced from WordNet2 (2004).

4.3.3 Proposed Implementation

The WordNet hierarchy forges links between words that are interchangeablein a given context. These words point to the same synset. Those wordsthat are synonymous are grouped into synsets which represent the conceptdescribed by their shared meaning. Not only is there a relationship betweenwords in a particular synset there exists numerous links between the synsetsthemselves. Of particular pertinence is the hyponym and hypernym hierar-chy. A hyponym synset of a particular synset contains words that are morespecific with respect to an underlying theme than the original synset. A

Page 25: Generation of Themed Portable Crosswords A WordNet ... · PDF fileGeneration of Themed Portable Crosswords A WordNet Implementation ... not been submitted as an exercise for a degree

CHAPTER 4. PROJECT GOALS 21

hypernym synset of a particular synset contains words that are less specificwith respect to an underlying theme than the original synset.

Word = ’dog’Gloss: a member of the genus Canis;

Hyponyms of ’dog’: pooch, doggyGloss: Informal terms for dogs

Figure 4.1: Hyponym & Hypernym Examples

Hypernyms of ’dog’: canine, canidGloss: fissiped mammals with nonretractile claws[...]

Hence an algorithm exploiting this data structure would ensure that onlywords directly relevant to the theme be returned to the program. A moredetailed discussion of WordNet follows in Chapter 5.

4.3.4 Why a MySQL version of WordNet2?

There are many versions of WordNet available: Windows, Linus, Prologversions etc. Other individuals have developed a WordNet2 Java interface.This is a series of Java classes that can be used to query a WordNet database.Given that the Crossword Generator is coded almost exclusively in Java itwould seem logical to use the Java interface available to query the WordNetdatabase. However, this approach was rejected on the following grounds:

• Employing the Java interface would result in the importation of a num-ber of classes - many of whom are not required by the Crossword Gen-erator

• The methods within the Java interface do not correspond exactly tothe requirements of the algorithm described in Section 6.3. Methodswould require modification.

For these reasons, it was decided that the inclusion of a WordNet2 MySQLdatabase and the provision of suitable methods to query this MySQL data-base constituted a more efficient means of integrating WordNet with theexisting system.

Page 26: Generation of Themed Portable Crosswords A WordNet ... · PDF fileGeneration of Themed Portable Crosswords A WordNet Implementation ... not been submitted as an exercise for a degree

CHAPTER 4. PROJECT GOALS 22

4.4 Restriction of Database Access

4.4.1 Why Restrict Database Access?

At present, anybody can upload files to the server using the “upload data-base” option. This could result in the uploading of corrupt files and lead toserver down-time.

4.4.2 Proposed Implementation

An improvement to the current system would be to password protect thedatabase uploading feature. This would be particularly useful in a class-room environment whereby only the teacher could upload information to theprogram. Students would merely have rights to create and solve themedcrosswords.

Ideally, upon selecting the upload database option the user should beasked to submit a password. If this password matches the the passwordstored in the database access is granted, otherwise access is refused. Thepassword should be stored in the database and not in the Java file as chang-ing the password would require the re-compilation of the Java file it is in.Hence the most efficient solution is the storing of the password in a table inthe database.

4.5 Conclusion

Figure 4.2 summarises both the structure of the proposed system as well asthe the flow of data between each of it’s components. Commmunication be-tween components is fundamental to the success of the project and in Figure4.2 is indicated by means of directional arrows.

Page 27: Generation of Themed Portable Crosswords A WordNet ... · PDF fileGeneration of Themed Portable Crosswords A WordNet Implementation ... not been submitted as an exercise for a degree

CHAPTER 4. PROJECT GOALS 23

Figure 4.2: System Structure & Data-flow

Page 28: Generation of Themed Portable Crosswords A WordNet ... · PDF fileGeneration of Themed Portable Crosswords A WordNet Implementation ... not been submitted as an exercise for a degree

Chapter 5

WordNet - A Lexical Resource

5.1 Introduction

In this section background information is provided on the nature of WordNet.Next more detailed information is provided on the WordNet hierarchicalstructures. Limitations of WordNet as a lexical resource are discussed withreference to Vogel and Devitt (2004) and Devitt (2004). Reference is madeto other applications that employ WordNet in their implementation. Finally,the reasons for WordNet’s inclusion in the project are outlined.

5.2 What is WordNet?

WordNet is, according to its founders, an ”on-line lexical database”. Word-Net is hand-coded. WordNet is much more than an electronic dictionary andindeed it’s structure distinguishes it from established lexical resources suchas The Oxford English Dictionary.

WordNet employs a model of classifying words that aims to imitate howthe lexicon is organised in the human brain. This model emerged from psy-cholinguistic studies carried out over the past number of years. Hence pos-sible uses of WordNet extend way beyond searching for a definition for aparticular word or collocation. In fact the inverse of this is the case: one cansearch for a word or words associated with a given definition.

Page 29: Generation of Themed Portable Crosswords A WordNet ... · PDF fileGeneration of Themed Portable Crosswords A WordNet Implementation ... not been submitted as an exercise for a degree

CHAPTER 5. WORDNET - A LEXICAL RESOURCE 25

5.3 WordNet Statistics

Table 5.1 outlines the size of the WordNet2 database and the number of re-lationships that exist between words and meanings. Note that each uniquestring is considered as a single word entry. Table 5.1 is sourced from Word-Net2 (2004).

Part of Speech Unique Strings Synsets Total Word-Sense PairsNoun 114648 79689 141690Verb 11306 13508 24632

Adjective 21436 18563 31015Adverb 4669 3664 5808Totals 152059 115424 203145

Table 5.1: WordNet Statistics

5.4 Structural Aspects of WordNet

5.4.1 Synset

As stated in the final sentence of the introduction it is possible to queryWordNet for words associated with a particular definition. This is due tothe fact that central to the WordNet model is the principle of synonymy.Synonymy is the semantic relation that holds between two words that can(in a given context) express the same meaning. Those words that are syn-onymous are grouped into synsets which represent the concept described bytheir meaning. A Synset is hence a representation of a concept that containsa set of words that are interchangeable in some context. However as indi-cated in Fellbaum (1998), Pg 5.

”These synonym sets do not explain what the concepts are, theymerely signify that the concepts exist”

Given that words are grouped according to meaning/concept, multipleentries can exist for any given word. In essense, for every definition/meaningof a particular word or collocation there will exist a synset for that definitionin WordNet. Consider the following query:

Page 30: Generation of Themed Portable Crosswords A WordNet ... · PDF fileGeneration of Themed Portable Crosswords A WordNet Implementation ... not been submitted as an exercise for a degree

CHAPTER 5. WORDNET - A LEXICAL RESOURCE 26

SELECT word, gloss, ss type FROM ‘wn synset‘, wn gloss WHEREword=’sport’ AND wn synset.synset id = wn gloss.synset id

MySQL queries of this type will be explained in more detail at a laterstage. In short this query searches for the word sport in the WordNet data-base and all of its associated definitions, indicating the part of speech thatis assigned to the word in each instance. The results returned are as follows:

Word Definition POSsport an active diversion... nsport occupation of athletes who compete for pay nsport verbal wit nsport temporary summer resident of inland Maine nsport organism with characteristics resulting from chromosomal alteration nsport someone who engages in sports nsport play boisterously vsport wear/display in an ostentatious manner v

Table 5.2: WordNet Results for ”sport”

As can be observed in Table 1 WordNet contains eight separate entriesfor sport, each corresponding to a particular usage of the word. Each de-finition is identified by a unique numerical id. This allows the assignmentof many words to the same synset and furthermore allows for the setting ofrelationships between synsets.

Page 31: Generation of Themed Portable Crosswords A WordNet ... · PDF fileGeneration of Themed Portable Crosswords A WordNet Implementation ... not been submitted as an exercise for a degree

CHAPTER 5. WORDNET - A LEXICAL RESOURCE 27

5.4.2 Organisation of the WordNet Hierarchy

The constituent synsets of WordNet are inter-linked by relations. These rela-tions are either semantic or lexical in nature. Lexical relations hold betweenword forms, semantic relations hold between word meanings. All of theserelations are reflexive. What follows is a brief outline of each relation thatexists within the WordNet structure taken from WordNet2 (2004, pg 3).

• Synonymy & Antonymy

The synonymy relation facilitates the grouping of words that are inter-changeable in a particular context into the same synset.

Antonymy is a lexical relation that concerns itself with adjectives andadverbs, positing antonymous adjectives or adverbs in opposition to eachother. Examples of this relation include:

hot is an antonym of cold

fast is an antonym of slow

• Hyponymy & Hypernymy

These relations organise nouns and verbs into a hierarchical structurethrough which individual synsets are related to each other. The hypernymrelation is defined as follows:

“The generic term used to designate a whole class of specific instances. Yis a hypernym of X if X is a (kind of) Y.”

e.g. “canine” is a hypernym of “dog”

The hyponym relation can be described thus:

“The specific term used to designate a member of a class. X is a hyponymof Y if X is a (kind of) Y.”

e.g. “pooch” is a hyponym of “dog”

In simpler terms: hyponyms are more specific than the base word, hyper-nyms are more general than the base word.

Page 32: Generation of Themed Portable Crosswords A WordNet ... · PDF fileGeneration of Themed Portable Crosswords A WordNet Implementation ... not been submitted as an exercise for a degree

CHAPTER 5. WORDNET - A LEXICAL RESOURCE 28

• Meronymy & Holonymy

The meronym relation is defined as:

”The name of a constituent part of, the substance of, or a member of some-thing. X is a meronym of Y if X is a part of Y”

The following example illustrates the meronymy relation:

- Given: X = wheel, Y = car

- X is a meronym of Y as a wheel is a part of a car.

The inverse of the meronym relation is the holonym relation, defined asfollows:

”The name of the whole of which the meronym names a part. Y is a holonymof X if X is a part of Y.”

This example describes the nature of the holonym relation:

- Given: X = wheel, Y = car

- Y is a holonym of X as wheel is a part of a car.

• Entailment

A verb X entails Y if X cannot be done unless Y is, or has been, done

An example of this relation is the following:

- X = to breath out - exhale

- Y = to breath in - inhale

- Exhale entails inhale:- in order to exhale one must have inhaled

5.5 Limitations of WordNet

• Language

As WordNet was developed in America, American English is used in itsimplementation. American geography, state names and figures from Ameri-can history feature strongly in the database. Furthermore American expres-sions are also employed in describing synset concepts.

Page 33: Generation of Themed Portable Crosswords A WordNet ... · PDF fileGeneration of Themed Portable Crosswords A WordNet Implementation ... not been submitted as an exercise for a degree

CHAPTER 5. WORDNET - A LEXICAL RESOURCE 29

• Coverage

WordNet is a hand-coded lexical database. Hence, some concepts havebeen developed in greater detail than others. This is highlighted in Devitt(2004). The example given to illustrate this phenomenon is the following:

• Drogheda: site of 16th century battle

• Limerick: poem or a port city

Given that both Drogheda and Limerick are Irish towns of similar size,it is unusual that Drogheda not be considered a city like it’s south-westerncounterpart.

5.6 Existing WordNet Driven Applications

Given that use of WordNet is cost-free and that its source code is well docu-mented many researchers have adopted this tool for use in a variety of areasincluding:

• Disambiguation of Meaning

• Semantic Tagging

• Information Retrieval

• Conceptual Identification

• Machine Translation

• Document Classification

In addition, EuroWordNet, a european project based on WordNet, hasadopted WordNet’s basic structure and is developing WordNets for severalEuropean languages. At present this resource is not under general releaseand a fee is paid depending on the number of synsets requested.

WordNet developers are currently developing READER, a system de-signed to aid language learners in the acquisition of vocabulary. This systemis at present unavailable.

Page 34: Generation of Themed Portable Crosswords A WordNet ... · PDF fileGeneration of Themed Portable Crosswords A WordNet Implementation ... not been submitted as an exercise for a degree

CHAPTER 5. WORDNET - A LEXICAL RESOURCE 30

5.7 Conclusion

WordNet is a well established and highly sophisticated database. Despite thefact that it has been developed “by hand” topic coverage is relatively good.It’s inclusion in other natural language applications gives an indication of it’spopularity in the language technology community. WordNet’s hierarchicalstructure lends itself to numerous search algorithms for the extraction ofinformation it contains. Most importantly searches for thematically relatedwords are possible.

Page 35: Generation of Themed Portable Crosswords A WordNet ... · PDF fileGeneration of Themed Portable Crosswords A WordNet Implementation ... not been submitted as an exercise for a degree

Chapter 6

Integrating WordNet

6.1 Introduction

In this chapter the algorithms employed in the integration of a WordNet2MySQL database are explained in detail. Theoretical issues that arose arediscussed and changes made to the inherited system are outlined. Modifica-tions made to the generation of random symmetric grids are described andfeedback received on the themed crosswords is presented.

6.2 Software Required

The following packages were required to integrate WordNet to the exisitingsystem:

• WordNet2 MySQL database

This database was sourced from AndroidTechnologies (2005) and wasdeveloped from Prolog files used in the implementation of the Prolog versionof WordNet. It is a freely available tool.

• Java.sql

Java.sql is a class within the Java hierarchy that facilitates communicationbetween a Java program and a MySQL database. Queries can be executedon the database and the result set can be returned to the Java program forinterpretation.

• Java.io

Page 36: Generation of Themed Portable Crosswords A WordNet ... · PDF fileGeneration of Themed Portable Crosswords A WordNet Implementation ... not been submitted as an exercise for a degree

CHAPTER 6. INTEGRATING WORDNET 32

Java.io, a constituent class of the Java hierarchy makes possible “input”and “output” operations. This is of particular importance when workingwith server technology as information must be passed from, in this case, theprogram/applet to the server and from the server to the program/applet.

6.3 Basic Algorithm

1. User submits a valid theme

2. MySQL base query for primary synsets

3. MySQL query for hyponym synsets of each synset in 2

4. Iterate 3 five times

5. MySQL query for hypernym synsets of each synset in 2

6. Iterate 5 five times

7. Selecting a word of appropriate length from each synset returned bysteps 3 & 5

6.4 Algorithm Explained

• A Valid Theme

As described in the Section 4.3.3, the semantic relations pertinent to theretrieval of words belonging to a particular theme are the “Hyponym” and“Hypernym” relations. These relations can only be applied to singular com-mon nouns and verbs. You cannot for example search for a hyponym of thepreposition “at” nor the pronoun “she”. Hence the user must submit either asingular common noun or a verb to the program for the algorithm to functioncorrectly.

• Primary Synsets

The term “primary” synsets is attributed to the synsets in which the subjectword occurs. This is the starting point of future queries.

• Hyponym & Hypernym Synsets

Page 37: Generation of Themed Portable Crosswords A WordNet ... · PDF fileGeneration of Themed Portable Crosswords A WordNet Implementation ... not been submitted as an exercise for a degree

CHAPTER 6. INTEGRATING WORDNET 33

In Section 5.4.2 the terms Hyponym and Hypernym are discussed in de-tail. In summary a hyponym synset of a base synset contains words that aremore “specifically” related to a particular topic that those words in the basesynset. Similarly, a hypernym synset of a given synset will contain wordsthat are more “generally” related to a particular theme than those in theinitial synset.

Using the primary synsets as an intial starting point, steps 3 and 5 searchfor hyponym and hypernym synsets of the primary synsets. The first iterationof step 3 and 5 queries for hyponym and hypernym synsets of the primarysynsets returned in step 2. However successive iterations of steps 3 and 5 usethe last set of hyponym/hypernym synsets returned as their starting point.This results in the creation of chains of related hyponym and hypernymsynsets.

• Words of Appropriate Length

This algorithm must satisfy two separate constraints. Firstly, the wordsreturned must be thematically related to each other. Secondly, the wordsreturned must be able to satisfy the constraints of the random grid generated.That is to say, only words whose length corresponds to the requirements ofthe grid are accepted.

6.4.1 An Iterative Problem

The number of synsets returned by a particular query cannot be determinedin advance. This computational problem was solved in the following manner.Each query is executed once only, however the result set returned is iteratedthrough to determine its length. Next the data structure size is modifiedto accommodate the result set. Finally the result set is iterated through asecond time and the synsets returned are stored in the data structure.

6.4.2 The Magic Number 5

As can be observed in the algorithm, the searches for hyponym and hyper-nym synsets are iterated five times each. This is to ensure that all wordsassociated with the submitted theme are returned. The approach adoptedfollows statistics related to the WordNet 1.7 hierarchy presented by Vogeland Devitt (2004). Of particular pertinence is the following:

• 78.5% of synsets are “leaf-synsets”

Page 38: Generation of Themed Portable Crosswords A WordNet ... · PDF fileGeneration of Themed Portable Crosswords A WordNet Implementation ... not been submitted as an exercise for a degree

CHAPTER 6. INTEGRATING WORDNET 34

• Maximum distance from any synset to a leaf synset is 5

• Minimum distance from any synset to a leaf synset is 2

Leaf synsets are situated at the extremes of the WordNet hierarchy. Insimple terms, no other synset inherits from a leaf synset: there are no hy-ponym synsets of leaf synsets. 78.5% of synsets constitutes a very large ma-jority of synsets. Of even greater importance is the fact that the maximumdistance from any synset to a leaf synset is five synsets. Hence by iteratingthe hyponym and hypernym searches five times, full coverage is ensured.

6.5 Installation of the WordNet2 Database

The MySQL version of WordNet2 was sourced from Android Technologies(2004).A single .sql file contained all of the information required to install the data-base. This .sql file was uploaded to the MySQL database running on theEasyPHP system using the LOAD DATA LOCAL INFILE command for up-loading files containing series of MySQL statements. Due to its considerablesize (39.1 MB) the creation of the database took approximately 20mins.

6.6 Adaptation of WordNet2 Database

The WordNet2 database did not provide all the information that the cross-word generator requires to function effectively. In particular, in wn synset -the principal table in the WordNet2 database - there is no field that storesthe length of the word in the row. The easiest way to solve this problem wasto regenerate the table from a personally modified version of the Prolog fileassociated with the table. Figure 6.1 contains a sample of the file’s structure:

s(100001740,1,’entity’,n,1,11).

s(100002056,1,’thing’,n,12,0).

s(100002342,1,’anything’,n,1,0).

s(100002452,1,’something’,n,1,0).

Figure 6.1: Wn synset Prolog File Strucutre

Page 39: Generation of Themed Portable Crosswords A WordNet ... · PDF fileGeneration of Themed Portable Crosswords A WordNet Implementation ... not been submitted as an exercise for a degree

CHAPTER 6. INTEGRATING WORDNET 35

The entire Prolog file required re-formatting. The majority of this re-formatting was carried out using the “find-replace” procedure in the Emacseditor. Parentheses, periods and the leading ’s’ were removed followed by thereplacement of the separating commas by a blank space. The resulting datawas saved and passed to a Prolog file that parsed each line using the String-Tokenizer class (part of the Java hierarchy). An extra ’token’ was appendedto each string. This token is word length. Finally, each of the tokens wasplaced into a MySQL INSERT statement and written to file. An excerpt ofthe code is contained in Figure 6.2.

while(s != null){st = new StringTokenizer(s,” ”);

synset id = st.nextToken();w num = st.nextToken();word = st.nextToken();ss type = st.nextToken();sense num = st.nextToken();tag count = st.nextToken();length = word.length();

output = ”INSERT INTO wn synset VALUES(”+synset id+”,”+w num +”,”+word+”,”+ss type+”,”+sense num+”,”+tag count+”,”+”length”+”);”;

pw.println(output);s=br.readLine();}

Figure 6.2: Adaptation of Prolog File

The existing wn synset table was removed, it’s definition was extended toinclude the word length field and the file containing the INSERT statementswas uploaded to this new table. Once again, the LOAD DATA LOCALINFILE command was exploited to achieve this.

Page 40: Generation of Themed Portable Crosswords A WordNet ... · PDF fileGeneration of Themed Portable Crosswords A WordNet Implementation ... not been submitted as an exercise for a degree

CHAPTER 6. INTEGRATING WORDNET 36

6.7 Interfacing WordNet2 MySQL Database

& Java

With an adapted WordNet2 database in place, various methods were requiredto query the database in the manner outlined by the algorithm and in keepingwith the inherited program’s general logical sequence.

6.7.1 Java Data Structures Developed

Given that the synset is of great significance in WordNet and of great sig-nificance to the application, a Synset class was written describing a synsetobject. This object has two attributes:

• Synset Id – int

- The unique identifier of a synset

• Gloss – String

- The concept associated with a synset

As the WordNet2 database consists of synset queries rather than wordbased queries, a distinction is made during the programs execution to takeinto account which lexical resource has been selected. The words returnedfrom each query are recorded in two different arrays.

• WordData 2D array (possibleWords) containing all possible words

• Synset 2D array (wnWords) containing all possible words and theirsynset ID numbers

The WordData array is used by the application to write a Prolog filethat is subsequently queried in order to produce a solution set of words thatsatisfy the grid generated. The Synset array acts as a reference array. Whenthe solution set of words has been determined, it is necessary to query thedatabase for their respective definitions. As words occur in numerous synsetsnot keeping the synset ID number with the word could result in the retrievalof definitions that are not associated with the theme of the crossword.

Page 41: Generation of Themed Portable Crosswords A WordNet ... · PDF fileGeneration of Themed Portable Crosswords A WordNet Implementation ... not been submitted as an exercise for a degree

CHAPTER 6. INTEGRATING WORDNET 37

6.7.2 Connecting to the Database

Database connection is managed by the FillingGrid class, written by Grahamand extended in this project to include the interrogation of a WordNet data-base. A FillingGrid object is created within the MultiServerThread class.After a grid has been generated, the database is queried for words of suit-able length. This is achieved by invoking the writeProlog method on theFillingGrid object. Embedded in this method is another of FillingGrid’smember methods: getWords(String subject). This is the method responsiblefor connecting to the database and retrieving the words required. As statedin the Section 6.7.1, the search algorithm employed for querying a WordNetdatabase differs from that which queries standard electronic dictionaries. Thecode in Figure 6.3 illustrates the steps taken in querying and retrieving wordsfrom the database. The words returned are recorded in two data structuresas described in Section 6.7.1.

if (dicAddress.equals(WORDNET2)){System.out.println(”Recognises its a wordNet Dictionary”);for(int j=MIN WORD LENGTH; j<=MAX WORD LENGTH; j++){

//go through all word lengths requiredif((wordLengths[j] == true)&&(possibleWords[j][0].getWord().equals(NO WORD YET))){..//Querying database for length j wordstemp = database.getWNwords(subject,j);}//make sure there are words returnedif(temp.length>=1){posWords = new WordData[temp.length];for(int k=0; k<temp.length; k++){word = temp[k].getWord();posWords[k] = new WordData(word);}//record data in possibleWords and wnWordspossibleWords[j]=posWords; wnWords[j]=temp;}

Figure 6.3: Word Retrieval

Page 42: Generation of Themed Portable Crosswords A WordNet ... · PDF fileGeneration of Themed Portable Crosswords A WordNet Implementation ... not been submitted as an exercise for a degree

CHAPTER 6. INTEGRATING WORDNET 38

6.7.3 Retrieving the Words

As can be seen in Figure 6.3, the method responsible for returning words ofa particular length, pertaining to a particular theme, is getWNwords(subject,j). This is a member method of the DatabaseConnection class, developedby Graham and extended in this project to include methods that query aWordNet database. The getWNwords method contains several embeddedmethods that carry out steps 2 to 6 of the algorithm. These methods are:

• public Synset[] getPrimarySynsets(String subject)

– Base query, returning a synset array of all the synsets containingthe word represented by the String “subject”

• public Synset[] getHypo(Synset[] id)

– Returns an array of synsets that are hyponyms of the array ofsynsets represented by the Synset array “id”

• public Synset[] getHyper(Synset[] id)

– Returns an array of synsets that are hypernym synsets of the arrayof synsets represented by the Synset array “id”

• public Synset[] getWord(Synset[] id, int len)

– Returns an array of synsets objects which contain a word of length“len” and a synset ID number. One word is selected per synset inthe array “id”. The array “id” is a concatenation of all the arraysreturned by successive calls of getPrimarySynsets, getHypo andgetHyper methods.

In keeping with the algorithm, each time getWNwords is called, getPri-marySynsets is invoked once, getHyper and getHypo are called five timeseach and finally, the getWord method is called once. Within each of thesemethods objects from the Java.sql package are employed to send SQL queriesto the database are created. A separate SQL query is executed for each ofthe methods above. These queries are dynamic - they vary depending on thesubject and word length requested.

The code excerpt in Figure 6.4 is an example of an SQL query takenfrom the getHyper method. Note that the number of Synsets returned bythe query is recorded. This is to facilitate the creation of a Synset arraywhose size corresponds to the size of the result set, thus avoiding array out

Page 43: Generation of Themed Portable Crosswords A WordNet ... · PDF fileGeneration of Themed Portable Crosswords A WordNet Implementation ... not been submitted as an exercise for a degree

CHAPTER 6. INTEGRATING WORDNET 39

for(int i = 0; i<id.length; i++){//prepare the statement:get hyper = connection.prepareStatement(”select synset id 2 from wn hypernym where synset id 1 =”+id[i].getSynsetId()+”;”);

//assign result set to be equal to whats returned by DBhyperRS = get hyper.executeQuery();

//count number of synsets returned and store in numSynswhile(hyperRS.next()){synset = hyperRS.getInt(”synset id 2”);tnumSyns++;}}

Figure 6.4: SQL Hypernym Query

of bounds exceptions. When all words have been returned a Prolog file iswritten containing these words. Next the Prolog file is queried by functionsin the file functions.pl and should a solution set of words be found, they arecommunicated to the application. Further information regarding the Prologpowered solution retrieval can be found in Graham (2003).

6.7.4 Retrieving the Definitions

The storeSolution method in the FillingGrid class records the words thatmake up the solution set as well as their positions in the grid. It also re-trieves the definitions associated with each of the words in the result set fromthe database. Given that this method involves querying the database, it wasnecessary to re-write it incorporating WordNet search methods.

The solution set, as well as being recorded in the WordSpace words array,is also recorded in the Synset wnSolutionSet array. wnSolutionSet includesboth the word and the synset id, referenced from the wnWords synset arraywhich was populated in the getWords method, thus conserving the link tothe appropriate definition. Next the database is queried for each word’s def-inition.

The code excerpt in Figure 6.5 is taken from the storeSolution method

Page 44: Generation of Themed Portable Crosswords A WordNet ... · PDF fileGeneration of Themed Portable Crosswords A WordNet Implementation ... not been submitted as an exercise for a degree

CHAPTER 6. INTEGRATING WORDNET 40

and illustrates, the retrieval of definitions and also the transfer of informa-tion from the wnSolutionSet array to the words array. The getSynsetGlossis a member method of the DatabaseConnection class. It’s function, is toretrieve the definitions associated with each of the synset id’s passed to it inthe form of a Synset array. This method returns another Synset array, witheach object in the array containing a synset id number and it’s associateddefinition.

System.out.println(”Getting wordNet definitions”);//gets definition for each word in wnSolutionSettemp = database.getSynsetGloss(wnSolutionSet);

//copies defintion/clue num from wnSolutionSet to words[]for(int j=0; j<wordspace end; j++){target = words[j].getWord();

for(int k=0; k<wnSolutionSet.length; k++){//iterating through wnSolutionSet to find corresponding word

if(wnSolutionSet[k].getWord().equalsIgnoreCase(target)){cible = wnSolutionSet[k].getSynsetId();

//iterating through definitions/synset id’sfor(int l = 0; l<temp.length; l++){//if both synset id’s match have defintionif(temp[l].getSynsetId()==cible){

//clue number and definition transferred to words[]words[j].setNumClues(1);words[j].setClue(0,temp[l].getWord());break;}}break;}}

Figure 6.5: Definition Retrieval

Page 45: Generation of Themed Portable Crosswords A WordNet ... · PDF fileGeneration of Themed Portable Crosswords A WordNet Implementation ... not been submitted as an exercise for a degree

CHAPTER 6. INTEGRATING WORDNET 41

6.7.5 Removing Multiple Forms of Solution From AClue

As stated in Section 2.8, Graham does not successfully remove all forms ofthe solution from the clue. To overcome this problem, it was decided toextend the removeAnswerFromClue method, a member method of the Solu-tion class. Use was made of the replaceAll(string this,string that) methodavailable in the Java.String class. This method replaces occurrences of thestring “this” with the string “that”. The aim was to remove the solutionwhether it occurred at the end or in the middle of a sentence, in it’s plural,past particible, present particible, adverbial and superlative forms. Graham(2003) successfully removes occurrences of the solution in all parts of theclue, but does not deal with other morphological forms of the solution. Anoutline of the extension to the removeAnserFromClue method is given belowand involves searching for representative strings:

• Solution in middle of sentence

– whitespace + answer + whitespace

• Solution at the end of a sentence

– whitespace + answer + ”.” or ”!” or ”?” or ”:” or ”;”

The occurrences of plurals, present and particible are found in a similarmanner and are sought both in the middle or at the end of the sentence:

• Plural Forms in the middle of a sentence

– whitespace + answer + ”s” + whitespace

• Past & Present Particibles

– whitespace + answer + ”ed” or ”d” or ”ing” + whitespace

• Adverbial & Superlative Forms

– whitespace + answer + ”ly” or ”ily” or ”er” or ”est” + whitespace

This method clearly does not take into account those words whose pluralor other forms do not follow general morphological rules. In many instancesexceptional cases result in a complete change to the word itself - (e.g. eat :ate) thus ensuring that the actual solution would not appear in the clue text,therefore coverage of exceptional cases is in many instances not required.

Page 46: Generation of Themed Portable Crosswords A WordNet ... · PDF fileGeneration of Themed Portable Crosswords A WordNet Implementation ... not been submitted as an exercise for a degree

CHAPTER 6. INTEGRATING WORDNET 42

6.8 Grid Generation

Graham(2003) implemented random symmetric grid generation. However,many of the grids contained a large proportion of one and two letter words.This characteristic does not lend itself to the production of themed cross-words. Very few, if any, one or two letter words “belong” to a theme. Prepo-sitions like “to”, “in” and “at” are not covered by the hypernym and hy-ponym semantic relations and are hence not going to occur in any theme.The problem could be solved in one of two ways:

• Solution A: 1 & 2 letter words in WordNet available to all grids

- Quality of crossword dependant on random grid generated

• Solution B: Generation of random grids - but only those without 1 &2 letter words

– High-quality themed crosswords up to grid size 6/7

– Server fatigue resulting in larger gridsizes not functioning correctly

– Higher failure rate - fewer crosswords generated when requested

6.8.1 Quality versus Quantity

The decision boiled down to whether the quality of the crosswords was ofgreater importance than the number of them produced. Given that the goalwas to create themed crosswords, the second solution was chosen. Further-more, allowing one and two letter words appear in the grid had an inconsis-tent bearing on the result - some crosswords contained more words related tothe theme than “filler” words whereas it was more frequently the case thatthere were more filler words than thematically related words. This is evidentfrom the following sample crossword:

Page 47: Generation of Themed Portable Crosswords A WordNet ... · PDF fileGeneration of Themed Portable Crosswords A WordNet Implementation ... not been submitted as an exercise for a degree

CHAPTER 6. INTEGRATING WORDNET 43

Themed Crossword: Earth

IUA12

M

11

L10

R9

A8

M

W7

S

6

SSE5

N

4

D3

N2

A1

S

ACROSS1 a loose material consisting of grains of rock

or coral (4)5 a strip of land projecting into a body of

water (4)8 a loose and crumbling earthy deposit con-

sisting mainly of calcite or dolomite; usedas a fertilizer for soils deficient in lime (4)

12 the second largest of the Hawaiian Islands(4)

DOWN7 a master’s degree in science (2)2 ***** associate degree in nursing (2)9 modulation of the amplitude of the (radio)

carrier wave (2)3 a midwestern state on the Great Plains (2)10 ancient hawk-headed Egyptian sun god; a

universal creator (2)4 an honorary degree in science (2)11 a trivalent metallic element of the rare

earth group; usually occurs in associationwith yttrium (2)

6 the compass point midway between southand west; at 225 degrees (2)

Figure 6.6: Grid Containing 1 & 2 Letter Words

Page 48: Generation of Themed Portable Crosswords A WordNet ... · PDF fileGeneration of Themed Portable Crosswords A WordNet Implementation ... not been submitted as an exercise for a degree

CHAPTER 6. INTEGRATING WORDNET 44

At least with the second solution, when a crossword is generated a highquality result is guaranteed. This can be observed in the next sample cross-word:

Themed Crossword: Sport

GNIE8

BP

UTI

7

PEVI6

D

L

TNU5

HW

ITO

4

WK3

AE2

R1

F

ACROSS1 a person or animal that is markedly un-

usual or deformed (5)5 the pursuit and killing or capture of wild

animals regarded as a sport (4)6 a headlong plunge into water (4)8 a living thing that has (or can develop) the

ability to act or function independently (5)

DOWN6 a brief swim in water (3)2 the act of ****** as a sport (3)3 a person trained to compete in sports (7)7 a humorous play on words; ‘I do it for the

****** of it’; ‘his constant punning irri-tated her’ (3)

4 a message whose ingenuity or verbal skillor incongruity has the power to evokelaughter (3)

Figure 6.7: Grid Free of 1 & 2 Letter Words

Page 49: Generation of Themed Portable Crosswords A WordNet ... · PDF fileGeneration of Themed Portable Crosswords A WordNet Implementation ... not been submitted as an exercise for a degree

CHAPTER 6. INTEGRATING WORDNET 45

6.9 Independent Analysis of Themed Cross-

words

In order to determine whether or not the system actually succeeds in creatingthemed crosswords an experiment was carried out. In this experiment a totalof twenty individuals, both male and female, spread between the ages of 18and 60 were presented with a completed crossword puzzle produced by theprogram. Their task was to “Guess the Theme”. There was no time limitset for this task, but participants were asked to follow their “gut” instinct.Participants could respond in sentence form, single word or a couple of wordsthat they felt best described the theme of the crossword. A total of eightcrosswords were presented to the participants. The following themes werecovered:

• Sport

• Water

• Music

• Pick

• Match

• Food

• Animal

• Colour

The themes were selected so as to provide a varying level of abstractionand hence difficulty. Of the themes selected sport, water, pick, match andcolour can be interpreted as a noun or a verb. Food, animal and music are allnouns. It would be expected that the first group pose more problems thanthan the second given the extra degree of complexity. Furthermore, giventhat pick is primarily employed as a verb the crossword generated containsnumerous verbal synonyms and is hence more difficult to identify it’s theme.The crosswords presented to the participants can be viewed in Appendix A.

Participants were asked to state whether or not they ever studied linguis-tics and if so in what capacity. After the experiment, the subjects notedwhich crossword they found most difficult and which they found easiest.

Page 50: Generation of Themed Portable Crosswords A WordNet ... · PDF fileGeneration of Themed Portable Crosswords A WordNet Implementation ... not been submitted as an exercise for a degree

CHAPTER 6. INTEGRATING WORDNET 46

6.9.1 Interpretation Of Responses

In order to accurately analyse results a sliding scale was employed. It wasdecided that responses that included the exact word entered be consideredas positive results. Words that could be considered as being part of the samedomain were also accepted but accorded less importance. An example of aword/phrase belonging to a particular domaine is:“athletic skill”, a memberof the “sport” domain. Domain membership was verified using WordNet’shyponym and hypernym semantic relations. Needless to say responses thatwere outside of the subject domain were considered as being negative results.

6.9.2 Results

• Crossword 1: Sport

– Sample of Participant Responses:

- sport, activity, athletic skill, actions

• Crossword 2: Water

– Sample of Participant Responses:

- liquid, water, bodies of water, flowing, rivers & lakes, nature

• Crossword 3: Music

– Sample of Participant Responses:

- music, musical forms/terminology, work

• Crossword 4: Pick

– Sample of Participant Responses:

- actions, directions, hobbies, making decisions, sorry haven’ta clue

• Crossword 5: Match

– Sample of Participant Responses:

- being influenced by others, ranking of respect, recognition,fitting in, dunno, changing form,imitate

• Crossword 6: Food

– Sample of Participant Responses:

Page 51: Generation of Themed Portable Crosswords A WordNet ... · PDF fileGeneration of Themed Portable Crosswords A WordNet Implementation ... not been submitted as an exercise for a degree

CHAPTER 6. INTEGRATING WORDNET 47

- food, food & drink, eating & drinking

• Crossword 7: Animal

– Sample of Participant Responses:

- birds, insects & lizards, animals, flying creatures, small ani-mals, birds, insects of the animal kingdom, feathers & fins

• Crossword 8: Colour

– Sample of Participant Responses:

- colour, colouring, in colour, colour & mediums used by artists,painting

• Overall Results

A total of 20 individuals participated in the evaluation process. Statisticalresults for each of the crosswords are detailed in Table 6.1.

Correct Domain IncorrectCrossword 1 70% 20% 10%Crossword 2 30% 70% 0%Crossword 3 90% 10% 0%Crossword 4 0% 10% 90%Crossword 5 0% 10% 90%Crossword 6 90% 10% 0%Crossword 7 60% 40% 0%Crossword 8 70% 20% 10%

Table 6.1: Crossword Evaluation Results

6.9.3 Discussion of Results

The results presented in Table 6.1 are largely predictable.

Themes were largely successfully chosen by the participants for cross-words 1, 2, 3, 6, 7 and 8 - only 10% of responses to crosswords 1 and 8 wereentirely unrelated to the theme.

Crosswords 4 and 5 scored poorly given the high level of abstractionassociated with the theme words selected: pick and match. Although the

Page 52: Generation of Themed Portable Crosswords A WordNet ... · PDF fileGeneration of Themed Portable Crosswords A WordNet Implementation ... not been submitted as an exercise for a degree

CHAPTER 6. INTEGRATING WORDNET 48

participants were not informed as to the syntactic category that the themewords belonged to, the responses returned for crosswords’ 4 and 5, althoughoutlandish, were largely verbal.

Whether the participant had or does study linguistics had no bearingon the overall results. However, upon completion of the evaluation, theparticipants were given the correct theme for each crossword. In general,participants “understood” why a particular theme could be associated witha crossword, but linguists were naturally quicker to recognise the themesrelevance to the crossword.

6.10 Conclusion

Through the integration of WordNet, the crossword generator now success-fully generates “themed” crosswords. The findings of the crossword evalu-ation survey confirm this fact. The algorithm employed for the extractionof thematically related words ensures that all relevant words are returned tothe program for consideration. Adaptation of the WordNet2 MySQL data-base contributes to this process. Another distinct advantage of the currentsystem is that it opens door to easily integrating EuroWordNet and it’sInter-Lingual-Index, which will allow the production of multi-lingual themedcrosswords, where the clues could be presented in one language (e.g. French),with the solutions expected in the target language (e.g. English).

Careful theme selection produces interesting results. Conventional themes,like for example ”language”, ”country”, ”food”, ”sport” produce consistentlygood crosswords, indicating that in a language learning environment, cross-words can be reliably produced for “popular” themes . More “original”themes, like for example “pick” or “match”, provide highly-interesting, ab-stract crosswords which require a greater level of lateral thinking to determinetheir theme. These could be described as ”verbally synonymous” crosswords,where light is shed on the relationship between verbs and expressions as op-posed to noun-noun relationships.

A sample of crosswords produced by the system can be found in AppendixC and D.

Page 53: Generation of Themed Portable Crosswords A WordNet ... · PDF fileGeneration of Themed Portable Crosswords A WordNet Implementation ... not been submitted as an exercise for a degree

Chapter 7

Integration of the PrintingInterface

7.1 Introduction

In this section the tools and algorithms employed in the production anddevelopment of the “Printable Portable Crosswords” extension are explainedand discussed in detail. Furthermore, pitfalls and problems encounteredduring the development of this feature are also discussed.

7.2 Tools Required

7.2.1 LATEX

LATEX is a document preparation system for high-quality type-setting, basedon Donald E Knuth’s “TEX” type-setting languge. For Knuth, TeX is

“intended for the creation of beautiful books - and especially forbooks that contain a lot of mathematics”

Here the intention is to create beautiful crosswords, in keeping withKnuths tradition! Leslie Lamport is the founding father of LATEX, howeverLATEX is now developed by the LATEX3 Project.

7.2.2 Source

The Windows version of LATEX, MikTeX takes approximately 90mins todownload and install and is available at: http://www.miktex.org/. LATEXdocumentation can be sourced at (LaTeX, 2004).

Page 54: Generation of Themed Portable Crosswords A WordNet ... · PDF fileGeneration of Themed Portable Crosswords A WordNet Implementation ... not been submitted as an exercise for a degree

CHAPTER 7. INTEGRATION OF THE PRINTING INTERFACE 50

7.2.3 Features

With LATEX the content and layout are specified separately. This allows forthe production of a standard “template” and the “plugging in” of relevantcontent as required. This is particularly useful for the crossword generator asthat way standard characteristics of the crossword are described in advance:

• Consists of a grid

• Set of numbered clues

• Clues refer to a particular cell in the grid

• Clues are either across or down

• Solutions have a particular length

• Solutions are linked to a clue number

• Solutions have a particular starting point on the grid (row & columnnumber)

• Those cells that do not contain a letter are black

• Grid can be displayed with or without its solution

LATEX is particularly suited to the production of scientific reports andmathematical papers. This is due to its adaptability with respect to the dis-play of mathematical formulae and other figures. It would also be very diffi-cult, or nearly impossible, to communicate to another documentation system,such as Microsoft Word, the various parameters associated with crosswordgeneration : gridsize, position of black/white squares, direction of clues andwords in the grid.

For these reasons and the fact that LATEX is freely available on-line it wasdecided that LATEX be employed in this project.

7.2.4 Packages

LATEX has and continues to be updated by people around the world. Whereparticular features do not exist in the LATEX class hierarchy, classes can bedeveloped to encapsulate what is missing. This is the case with the crosswordclass file. The author of crosswrd.sty, as distributed with the current ver-sion of MiKTeX, is Frank Mittelbach. Mittelbach extended Brian HamiltonKelly’s version of the .sty file to ensure its compatibility with LATEX2e, thelatest version of LATEX.

Page 55: Generation of Themed Portable Crosswords A WordNet ... · PDF fileGeneration of Themed Portable Crosswords A WordNet Implementation ... not been submitted as an exercise for a degree

CHAPTER 7. INTEGRATION OF THE PRINTING INTERFACE 51

7.2.5 crosswrd.sty

The structure of this file allows for the specification of many parameters thatare related to the crossword:

• Grid Size

• Display Soultion?

There are also parameters that contain information relevant to the puz-zle’s clues and their respective solutions:

• Number

• Direction

• Column Number

• Row Number

• Solution

• Text

• Length of Solution

To gain access to this resource the .tex file or “source file” must containa reference to this particular package. This is achieved by the followingcommand:

- \usepackage{crosswrd}

7.2.6 Structure of the .tex file

Given that layout and content are treated separately in LaTex the generationof a suitable .tex file is trivial. There are three main sections to the .tex file.

The first section contains information with regard to the classes sourcedin the document, height of text, size of margins:

Page 56: Generation of Themed Portable Crosswords A WordNet ... · PDF fileGeneration of Themed Portable Crosswords A WordNet Implementation ... not been submitted as an exercise for a degree

CHAPTER 7. INTEGRATION OF THE PRINTING INTERFACE 52

\documentclass{article}\usepackage{crosswrd}\pagestyle{empty}\setlength\topmargin{-1in}\setlength\textheight{10.7in}\begin{document}

Figure 7.1: TEX File 1st Section

The third section contains tags that ”close” the file correctly:

\end{crossword}\end{document}\endinput

Figure 7.2: TEX File 3rd Section

In between these two sections commands relating to the nature of theclues and solutions are stored. These have a set standard format, only theinformation contained within its parameters is subject to change.

\begin{crossword}{GRIDSIZE}{SHOW ANSWERS Y or N?}\begin{crossword}{5}{Y}\clue{clue num}{A/D}{col}{row}{ans}{clue}{ans length}\clue{1}{A}{2}{1}{ARIA}{an elaborate song for solo voice}{4}

Figure 7.3: TEX File Clue Section

7.3 Conversion of TEXFile to PDF File

The LATEX environment contains various tools one of which facilitates theconversion of .tex files to .dvi files. Assuming system classpath variableshave been set appropriately it should be possible to execute the followingcommand line argument and thus create a .dvi file. The name of the fileshould be substituted for “filename”.

- latex filename

Page 57: Generation of Themed Portable Crosswords A WordNet ... · PDF fileGeneration of Themed Portable Crosswords A WordNet Implementation ... not been submitted as an exercise for a degree

CHAPTER 7. INTEGRATION OF THE PRINTING INTERFACE 53

The next step in the process is to convert this file to PDF. Again thisrequires a simple command line invocation of:

- pdflatex filename

Note, on Linux systems the appropriate tool is ’dvipdf’ and not ’pdflatex’

7.4 Integrating the production of PDF files

with the current system

As can be easily remarked from the previous sections the production of aPDF file requires that several criteria be met and that several sequentialstages take place.

7.4.1 Stage One - User Interaction

Files are only generated at the users request and to the users requirements.Via a drop down menu and “Create PDF” button on the applet the usercan indicate whether she/he requires a blank crossword grid or a completedcrossword to be created with the appropriate clues. This interaction is con-trolled by methods within the Crossword class.

The user is asked to submit a filename for their crossword. The .tex .dviand .pdf files generated during the process described below will be saved asfilename.tex, filename.dvi and filename.pdf respectively.

7.4.2 Stage Two - Production of .tex file

The only dynamic aspect of any .tex file that the system is going to producewill be the first and second sections of the .tex file. In section three theinformation can be hard coded from the outset.

Whether the user has requested a blank or complete solution to the puz-zle is recorded at runtime by the action listener assigned to the print formatchoice menu on the applet. The method concerned is the print method foundin the Crossword class.

- printFormat.getSelectedItem()

Page 58: Generation of Themed Portable Crosswords A WordNet ... · PDF fileGeneration of Themed Portable Crosswords A WordNet Implementation ... not been submitted as an exercise for a degree

CHAPTER 7. INTEGRATION OF THE PRINTING INTERFACE 54

Similarly, information pertaining to grid size is also available at runtimeand can be accessed as follows:

- gridSize.getSelectedItem()

This information, together with the size of the grid is then inserted intothe following string:

pre = ”documentclass{article}usepackage{crosswrd}pagestyle{empty}setlengthtopmargin{-1in}setlengthtextheight{10.7in}begin{document}begin{crossword}{”+gridSize+”}{”+blank+”}”;

Clue and solution data is stored in the “solution” data structure. Thisdata structure stores all information pertaining to the crossword solution andcan be very easily accessed from within the program at runtime.

A for-loop loops through the contents of the solution array. For eachelement in the array the required information is extracted using methods fromthe Solution class and the information is appended to the string allClues:

The text relating to sections one and three is stored as two separatestrings. Finally each of the three strings are sent to the server so that theymaybe printed to a file, named by the user, using the FileWriter and Print-Writer objects supplied as part of Java.io. File writing and conversion iscarried out server-side and is as such detailed in the MultiServerThread class

7.4.3 Stage Three - Production of DVI and PDF files

The methods used to produce DVI and PDF files are similar. Java Runtimeand Process objects are used to access command line features available onthe system. The execution of commands independent of the current programis possible but can be constrained by available system memory.

The only distinction made when initiating the PDF file conversion is:

- cmd = ”pdflatex usercw”;

Page 59: Generation of Themed Portable Crosswords A WordNet ... · PDF fileGeneration of Themed Portable Crosswords A WordNet Implementation ... not been submitted as an exercise for a degree

CHAPTER 7. INTEGRATION OF THE PRINTING INTERFACE 55

for(int x = 0; x ¡ totalNum; x++){current = solution[x];number = current.getNumber();if(current.isAcross()){direction = ”A”;}else{direction = ”D”;}col = current.getFirstSquare().getCol()+1;row = current.getFirstSquare().getRow()+1;answer = current.getAnswer().toUpperCase();clue = current.getClue().replaceAll(”’”,”\’”);..length = current.getLength();allClues+=”\clue{”+number+”}{”+direction+”}{”+col+”}{”+row+”}{”+answer+”}{”+clue+”}{”+length+”}”;}

Figure 7.4: Java String Representation of TEX Clue Section

String cmd= “latex filename”Runtime r= Runtime.getRuntime();//check for free memoryint freemp= (int) (100*r.freeMemory()/r.totalMemory());System.out.println (freemp + “% of JVM memory is free.”);//create process objectProcess p=r.exec(cmd);

Figure 7.5: DVI and PDF Production

Page 60: Generation of Themed Portable Crosswords A WordNet ... · PDF fileGeneration of Themed Portable Crosswords A WordNet Implementation ... not been submitted as an exercise for a degree

CHAPTER 7. INTEGRATION OF THE PRINTING INTERFACE 56

7.4.4 Stage Four - Making the PDF File Available tothe User.

Due to security constraints it is exceptionally difficult to pass a file from theserver to the user via an applet. However, as can be experienced on millionsof sites on the internet files can be made available for downloading from anysite.

This aspect of the program exploits, once again, the Runtime objectsfound in the Java.io package. In this instance upon clicking the “View PDF”button the user is prompted to enter the filename including the .pdf ex-tension. Next runtime objects are created and the following command isexecuted:

- acrord32 filename.pdf

The above command causes the Adobe Acrobat Reader program to openand display the file specified in a new window. The user can then save orprint a copy as desired.

Page 61: Generation of Themed Portable Crosswords A WordNet ... · PDF fileGeneration of Themed Portable Crosswords A WordNet Implementation ... not been submitted as an exercise for a degree

CHAPTER 7. INTEGRATION OF THE PRINTING INTERFACE 57

7.5 Sample Output

7.5.1 Solution

Themed Crossword: Sport

GNIE8

BP

UTI

7

PEVI6

D

L

TNU5

HW

ITO

4

WK3

AE2

R1

F

ACROSS1 a person or animal that is markedly un-

usual or deformed (5)5 the pursuit and killing or capture of wild

animals regarded as a sport (4)6 a headlong plunge into water (4)8 a living thing that has (or can develop) the

ability to act or function independently (5)

DOWN6 a brief swim in water (3)2 the act of ****** as a sport (3)3 a person trained to compete in sports (7)7 a humorous play on words; ‘I do it for the

?????? of it’; ‘his constant punning irri-tated her’ (3)

4 a message whose ingenuity or verbal skillor incongruity has the power to evokelaughter (3)

Figure 7.6: Solution Crossword

Page 62: Generation of Themed Portable Crosswords A WordNet ... · PDF fileGeneration of Themed Portable Crosswords A WordNet Implementation ... not been submitted as an exercise for a degree

CHAPTER 7. INTEGRATION OF THE PRINTING INTERFACE 58

7.5.2 Blank

Themed Crossword: match

5

4

321

ACROSS4 imitate uncritically and in every aspect;

”Her little brother ******** her behavior”(3)

5 compete for something; engage in a con-test; measure oneself against others (3)

DOWN1 a member of a widespread secret frater-

nal order pledged to mutual assistance andbrotherly love (5)

2 be sufficient; be adequate, either in qualityor quantity; ‘A few words would answer’;‘This car suits my purpose well’; ‘Will $100do?’; ‘A ’B’ grade doesn’t suffice to getme into medical school’; ‘Nothing else will******** ’ (5)

3 a friction match with a large head that willstay alight in the wind (5)

Figure 7.7: Blank Crossword

Page 63: Generation of Themed Portable Crosswords A WordNet ... · PDF fileGeneration of Themed Portable Crosswords A WordNet Implementation ... not been submitted as an exercise for a degree

CHAPTER 7. INTEGRATION OF THE PRINTING INTERFACE 59

7.6 Problems Encountered

The primary issue here concerned the escaping of illegal characters. Althoughthis very easily rectified, it proved troublesome during debugging as DVI andPDF files were produced with half of the text flying off the page and noapparent explanation. The problem charcaters are:

• &

• $

• %

• #

• {

• }

These characters can be escaped by preceding each occurence of them bya \. However, the backslash in Java is a special character, hence given thatJava is writing the file to the server each of these characters must be precededby TWO backslashes so that the Java interpreter will correctly print, forexample, \& in the .tex file so that the LATEX interpreter will successfullyprint &.

Java \\&LATEX\&

7.7 Conclusion

The printing interface developed is intuitive and easy to use. A great degreeof optionality is afforded to the user. Crosswords are available with andwithout solution, the user submits a filename of their choice and can chooseto print or save it to their own machine. The user has access to all crosswordsthey saved to the server.

Page 64: Generation of Themed Portable Crosswords A WordNet ... · PDF fileGeneration of Themed Portable Crosswords A WordNet Implementation ... not been submitted as an exercise for a degree

Chapter 8

Restricting Database Access

8.1 Introduction

The aim of this section is to provide a detailed account of how the restrictionof access to the database is implemented. Furthermore information will beprovided on how the super-user can change the password if required.

8.2 Implementation

This aspect of the program involved making changes to the user interface, theaddition of a password table to the dictionary database and the inclusion ofadditional methods in the MultiServerThread class and DatabaseConnectionclass.

8.3 Basic Algorithm

• Prompt user for password

• Check password against password in database

• Grant access if password is valid

• Otherwise refuse access

8.4 Changes to the Database

Another table, named PASSWORDS was added to the dictionary database.This table has two fields

Page 65: Generation of Themed Portable Crosswords A WordNet ... · PDF fileGeneration of Themed Portable Crosswords A WordNet Implementation ... not been submitted as an exercise for a degree

CHAPTER 8. RESTRICTING DATABASE ACCESS 61

• User

• Password

The following MySQL command was used to insert the table:

- CREATE TABLE PASSWORDS(user VARCHAR(20) NOT NULL,password VARCHAR(8) NOT NULL)

This table forms part of the dictionary database and can be accessed atall times during the execution of the program.

8.5 Changes Made to the MultiServerThread

Class

The purpose of this Java file is to control communications between the pro-gram and the database. Socket objects are used to connect to the server, bymeans of a thread, which in turn connects to the database. These objectsare initialised when the program starts and are available for its duration.The run method controls the flow of communication between the program,server and database. Several commands may be sent to this method so thatactions may be carried out. The actions included by Graham (2003) are thefollowing:

• Crossword Creation

• Uploading of Database (Text File Format)

• Uploading of Database (SQL format)

Another action was required namely a “password” method. This methodcommunicates to the applet whether or not the password is valid. Withinthis method a DatabaseConnection object, dictionaryDatabase, which en-capsulates the characteristics of the connection to the dictionary database,is employed. The boolean method isValidPassword(String s), a member ofthe DatabaseConnection Class is invoked on this object. The result returnedis recorded and is subsequently passed in String form to the applet.

Page 66: Generation of Themed Portable Crosswords A WordNet ... · PDF fileGeneration of Themed Portable Crosswords A WordNet Implementation ... not been submitted as an exercise for a degree

CHAPTER 8. RESTRICTING DATABASE ACCESS 62

if(inputLine.equals(PASSWORD)){String pass;boolean valid;try{pass = in.readLine();valid = dictionaryDatabase.isValidPassword(pass);if(valid){out.println(”YES”);}else{out.println(”NO”);}}

Figure 8.1: PASSWORD method in MultiServerThread

8.6 The isValidPassword Method

This method, a member of the DatabaseConnection class, is invoked by theMultiServerThread class. In isValidPassword a MySQL query is executed toextract the password from the database and the equals method from Java’sString class is used to compare the string returned by the MySQL query. Thereturn type of this method is boolean, hence true if the passwords match andfalse if they are different. This value is communicated to MultiServerThread.

public boolean isValidPassword(String s){PreparedStatement check pass;ResultSet pass;String password;try{check pass=connection.prepareStatement(”SELECT PASSWORD FROM pass-words WHERE user=’Teacher’;”);pass = check pass.executeQuery();pass.beforeFirst();pass.next();password = pass.getString(”PASSWORD”);if(s.equals(password)){return true;}

Figure 8.2: isValidPassword method in DatabaseConnection class

Page 67: Generation of Themed Portable Crosswords A WordNet ... · PDF fileGeneration of Themed Portable Crosswords A WordNet Implementation ... not been submitted as an exercise for a degree

CHAPTER 8. RESTRICTING DATABASE ACCESS 63

8.7 Adapting the Applet

The system developed by Graham (2003) for the uploading of data to thedatabase involves the user selecting “other” in the drop down menu of avail-able dictionary databases. Instead of being initially asked as to the nature ofthe database due to be uploaded, the user is firstly asked for a password. Thispassword is passed to MultiServerThread and MultiServerThread respondsto the applet in String form. A positive response results in the continuationof the database uploading process, a negative response results in the displayof a “Password Invalid” dialogue box.

password entered = newDictionaryPane.showInputDialog(”Please enter password:”);//call multiserverout.println(MultiServerThread.PASSWORD);//submit passwordout.println(password entered);//check responsevalid pass = in.readLine();if(valid pass.equals(”YES”)){form = newDictionaryPane.showInputDialog(”Is the new dictionary in the form of adatabase or a file?”);...

Figure 8.3: Display of Password Dialogue

8.8 Conclusion

The password entry procedure is coherent. The user is informed if they havenot entered a valid password. Furthermore changing the password is a trivialmatter as the super-user may alter it periodically in the dictionary databaseitself, which is accessible when the program is not running. This impliesthat recompilation of the Java source code is not necessary upon changing apassword as this implementation ensures that the password is independentof the program.

Page 68: Generation of Themed Portable Crosswords A WordNet ... · PDF fileGeneration of Themed Portable Crosswords A WordNet Implementation ... not been submitted as an exercise for a degree

Chapter 9

Provision of user Help File

9.1 Introduction

This section describes the content of the user help file and how it is madeavailable to the user.

9.2 Help File Contents

There are three main sections to the help file:

1. Crossword Generation

2. Uploading Databases

3. Changing Passwords

4. Viewing & Printing Crosswords

These sections cover issues that are likely to arise during the use of theprogram. The “Crossword Generation” section describes the kinds of cross-words that can be developed using each of the three database resources avail-able: WordNet2, Websters Unabridged Dictionary, a User Database. In eachinstance information is provided with respect to:

• Theme Selection

• Improving Success Rates

Page 69: Generation of Themed Portable Crosswords A WordNet ... · PDF fileGeneration of Themed Portable Crosswords A WordNet Implementation ... not been submitted as an exercise for a degree

CHAPTER 9. PROVISION OF USER HELP FILE 65

The “Uploading Databases” chapter describes the nature of the text filethat the user may wish to upload, underlining several required structuralproperties. Attention is also paid to stipulating the exact location of thetext file or database that is to be uploaded.

The “Changing passwords” section provides instruction on how to changethe password that permits the user to upload databases.

Finally, the section on “Viewing & Printing” crosswords describes thesteps necessary to produce a hard copy of the crossword generated.

9.3 Making Help File Available to the User

A “Help!” button was added to the interface. When this button is clickedthe applet communicates with the “MultiServerThread” class. From here,use is made of the Java.io package. Runtime and Process objects are created.These allow commands, normally executed manually at a command prompt,to be executed automatically from within the application. The followingcommand is executed on the Runtime object:

- acrord32 C:\Program Files\EasyPHP1-7\www\Crossword Generator\user.pdf

This results in the Adobe Acrobat Reader opening the user.pdf help file ina new window. This file can then be browsed while the program is executing.A copy of the user help file can be viewed in Appendix F.

9.4 Conclusion

The provision of a user help file enhances the system’s usability and will aidthe user in creating more interesting crosswords. The feature is available tothe user at all times.

Page 70: Generation of Themed Portable Crosswords A WordNet ... · PDF fileGeneration of Themed Portable Crosswords A WordNet Implementation ... not been submitted as an exercise for a degree

Chapter 10

Conclusion

The crossword generator has been extended considerably. Of particular noteis the successful integration of a WordNet2 MySQL database to facilitatethe generation of themed crosswords. The algorithm employed is such thatmaximum coverage of words within the WordNet2 database is guaranteed.Furthermore, the algorithm is sufficiently generic to accommodate WordNetsfor other languages. The themed crosswords developed are of a consistentlyhigh-quality, as confirmed by independent analysis.

The inclusion of a printing interface has further enhanced the functional-ity of the program in a language learning environment. Crosswords may beprinted and saved for future reference. Optionality is afforded to the user, inthat they can choose to have the crosswords displayed with or without thesolution.

Two new features that address security and usability include, controllingdatabase access by means of a password and the provision of a user help fileto deal with queries arising from the use of the program. These extensionscontribute to the development of the program as a “complete package” thataddresses all of the user’s requirements.

10.1 Further Study

An obvious extension of the current program would be the inclusion of otherWordNets. Given that all WordNets are built on the same underlying struc-ture, this aspect should be relatively easy to implement. Of greater difficulty,however, would be the integration of WordNet’s inter-lingual index, that links

Page 71: Generation of Themed Portable Crosswords A WordNet ... · PDF fileGeneration of Themed Portable Crosswords A WordNet Implementation ... not been submitted as an exercise for a degree

CHAPTER 10. CONCLUSION 67

synsets in one language with corresponding synsets in another language. Thiswould render the generation of multi-lingual themed crosswords possible.

A more efficient algorithm for the generation of random symmetric gridsfree of one and two letter words would enhance the program’s execution time.At present, grids are fully complete before they are tested for one and twoletter words. Ideally, grids should be tested at regular intervals during thegrid building process to remove doomed grids as early as possible. Decreasingthe number of black squares present in a grid will inevitably result in fewergrids containing one and two letter words.

An interesting study could involve the comparison of themed crosswordsgenerated by the crossword generator and the New York Times themed cross-words. Not only would this highlight the quality or otherwise of the generatedcrosswords, it may provide an insight into which concepts require further de-velopment within WordNet.

Finally, overcoming the technical difficulties currently experienced withLinux operating systems the Java Virtual Machine and SICStus Prolog wouldmake the program accessible to a wider audience.

10.2 Concluding Remarks

Overall, this project achieved exactly what it set out to achieve. Crosswordsare themed, printable and portable. WordNet has been successfully incor-porated into the system. The use of the program in a language learningenvironment is now a distinct possibility.

Page 72: Generation of Themed Portable Crosswords A WordNet ... · PDF fileGeneration of Themed Portable Crosswords A WordNet Implementation ... not been submitted as an exercise for a degree

Bibliography

Adobe (2005). Adobe Acrobat Reader.http://www.adobe.com/products/acrobat/readermain.html.

AndroidTechnologies (2005). WordNet2 MySQL Database. Android Tech-nologies, http://www.androidtech.com/html/wordnet-MySQL-20.php.

Berghel, H. & YI, C. (1989). Crossword compiler compilation. The ComputerJournal.

Devitt, A. (2004). Methods for Meaningful Text Representation and Com-parison. Ph.D. thesis, Trinity College Dublin.

EasyPHP (2004). EasyPHP.org, http://www.easyphp.org.

Fellbaum, C. (Ed.). (1998). WordNet: An Electronic Lexical Database (Firstedition). MIT Press.

Graham, Y. (2003). Random Crossword Generator with a Web User-Interface. Ph.D. thesis. Final Year Project, Trinity College Dublin.

LaTeX (2004). LaTeX2e Documentation. http://www.latex-project.org/guides/.

SICStus (2004). SICStus Prolog 3.12. SICStus Prolog,http://www.sics.se/isl/sicstuswww/site/documentation.html.

Sun (2005). Java 1.4.2 API Specifications. Sun Microsystems,http://java.sun.com/j2se/1.4.2/docs/api/.

Vogel, C. & Devitt, A. (2004). The Topology of WordNet: Some Metrics.Ph.D. thesis. Computational Linguistics Group, Trinity College Dublin.

WordNet2 (2004). WordNet2 Reference Manual. Princeton University,http://wordnet.princeton.edu/doc.

68

Page 73: Generation of Themed Portable Crosswords A WordNet ... · PDF fileGeneration of Themed Portable Crosswords A WordNet Implementation ... not been submitted as an exercise for a degree

Appendix A

Screen Shots

Figure A.1: Introductory Screen

Page 74: Generation of Themed Portable Crosswords A WordNet ... · PDF fileGeneration of Themed Portable Crosswords A WordNet Implementation ... not been submitted as an exercise for a degree

APPENDIX A. SCREEN SHOTS 70

Figure A.2: A Completed Crossword

Page 75: Generation of Themed Portable Crosswords A WordNet ... · PDF fileGeneration of Themed Portable Crosswords A WordNet Implementation ... not been submitted as an exercise for a degree

APPENDIX A. SCREEN SHOTS 71

Figure A.3: Creating PDF File

Page 76: Generation of Themed Portable Crosswords A WordNet ... · PDF fileGeneration of Themed Portable Crosswords A WordNet Implementation ... not been submitted as an exercise for a degree

APPENDIX A. SCREEN SHOTS 72

Figure A.4: Uploading to Database

Page 77: Generation of Themed Portable Crosswords A WordNet ... · PDF fileGeneration of Themed Portable Crosswords A WordNet Implementation ... not been submitted as an exercise for a degree

Appendix B

Evaluated Crosswords

Themed Crossword: 1

GNIE8

BP

UTI

7

PEVI6

D

L

TNU5

HW

ITO

4

WK3

AE2

R1

F

ACROSS1 a person or animal that is markedly un-

usual or deformed (5)5 the pursuit and killing or capture of wild

animals regarded as a sport (4)6 a headlong plunge into water (4)8 a living thing that has (or can develop) the

ability to act or function independently (5)

DOWN6 a brief swim in water (3)2 the act of rowing as a sport (3)3 a person trained to compete in sports (7)7 a humorous play on words; ‘I do it for the

?????? of it’; ‘his constant punning irri-tated her’ (3)

4 a message whose ingenuity or verbal skillor incongruity has the power to evokelaughter (3)

Page 78: Generation of Themed Portable Crosswords A WordNet ... · PDF fileGeneration of Themed Portable Crosswords A WordNet Implementation ... not been submitted as an exercise for a degree

Themed Crossword: 2

TSEG7

E

NRT

ENY6

TC

R5

EIR4

E

3

TNJ

ED2

UX1

E

ACROSS1 release (a liquid) in drops or small quanti-

ties; ‘ ********** sweat through the pores’(5)

4 the 4th largest of the Great Lakes; it islinked to the Hudson River by the NewYork State Barge Canal (4)

6 a river in northern England that flows eastto the North Sea (4)

7 eliminate from the body; ‘Pass a kidneystone’ (5)

DOWN1 eliminate (substances) from the body (5)2 an assemblage of parts that is regarded

as a single entity; ‘how big is that partcompared to the whole?’; ‘the team is a******** ’ (4)

5 a shallow salt lake in south central Aus-tralia about 35 feet below sea level; thelargest lake in the country and the lowestpoint on the continent (4)

3 a river in central England that flows gen-erally notheastward to join with the OuseRiver and form the Humber (5)

Page 79: Generation of Themed Portable Crosswords A WordNet ... · PDF fileGeneration of Themed Portable Crosswords A WordNet Implementation ... not been submitted as an exercise for a degree

Themed Crossword: 3

NEE5

K

NCL

GEO

II4

F

3

SU2

P1

O

ACROSS1 a musical work that has been created; ‘the

composition is written in four movements’(4)

5 a funeral lament sung with loud wailing (4)

DOWN4 people descended from a common ances-

tor; ‘his family has lived in Massachusettssince the Mayflower’ (4)

2 a musical work that has been created; ‘thecomposition is written in four movements’(5)

3 any communication that encodes a mes-sage; ‘signals from the boat suddenlystopped’ (4)

Page 80: Generation of Themed Portable Crosswords A WordNet ... · PDF fileGeneration of Themed Portable Crosswords A WordNet Implementation ... not been submitted as an exercise for a degree

Themed Crossword: 4

YRRE4

B

AE

3

WTY

NA

LA2

ET1

S

ACROSS1 take without the owner’s consent; ‘Some-

one stole my wallet on the train’; ‘This au-thor stole entire paragraphs from my dis-sertation” (5)

4 pick or gather berries; ‘We went ********in the summer’ (5)

DOWN1 express in words; ‘He said that he wanted

to marry her’; ‘tell me what is bother-ing you’; ‘state your opinion’; ‘state yourname’ (3)

2 to come or go into; ‘the boat entered anarea of shallow marshes’ (5)

3 doing as one pleases or chooses; ‘if I hadmy ******* ’ (3)

Page 81: Generation of Themed Portable Crosswords A WordNet ... · PDF fileGeneration of Themed Portable Crosswords A WordNet Implementation ... not been submitted as an exercise for a degree

Themed Crossword: 5

EEN

EI5

VO

ZRS

UEP4

A

3

F2

S1

M

ACROSS4 imitate uncritically and in every aspect;

‘Her little brother **** her behavior’ (3)5 compete for something; engage in a con-

test; measure oneself against others (3)

DOWN1 a member of a widespread secret frater-

nal order pledged to mutual assistance andbrotherly love (5)

2 be sufficient; be adequate, either in qualityor quantity; ‘A few words would answer’;‘This car suits my purpose well’; ‘Will $100do?’; ‘A ’B’ grade doesn’t suffice to getme into medical school’; ‘Nothing else will********** ’ (5)

3 a friction match with a large head that willstay alight in the wind (5)

Page 82: Generation of Themed Portable Crosswords A WordNet ... · PDF fileGeneration of Themed Portable Crosswords A WordNet Implementation ... not been submitted as an exercise for a degree

Themed Crossword: 6

GG8

EE

KDU7

P

A6

AI

EPR

TA5

O4

T

3

S2

PA1

P

ACROSS1 a diet that does not require chewing; ad-

vised for those with intestinal disorders (3)5 seed of the annual grass Avena sativa

(spoken of primarily in the plural as‘********’) (3)

7 (British) the dessert course of a meal (‘****** ’ is used informally) (3)

8 oval reproductive body of a fowl (espe-cially a hen) used as food (3)

DOWN4 lining of the stomach of a ruminant (espe-

cially a bovine) used as food (5)6 a sweetened beverage of diluted fruit juice

(3)2 a sweet drink containing carbonated water

and flavoring; ‘in New England they callsodas tonics’ (3)

3 a slice of meat cut from the fleshy part ofan animal or large fish (5)

Page 83: Generation of Themed Portable Crosswords A WordNet ... · PDF fileGeneration of Themed Portable Crosswords A WordNet Implementation ... not been submitted as an exercise for a degree

Themed Crossword: 7

LUANO6

M

LE

ODRI5

B

4

PSA3

WA

OR

EL2

TTU1

C

ACROSS1 ten-armed oval-bodied cephalopod with

narrow fins as long as the body and a largecalcareous internal shell (6)

3 social or solitary hymenopterans typicallyhaving a slender body with the abdomenattached by a narrow stalk and having aformidable sting (4)

5 warm-blooded egg-laying vertebrates char-acterized by feathers and forelimbs modi-fied as wings (4)

6 brilliantly colored pheasant of southernAsia (6)

DOWN1 decapod having eyes on short stalks and a

broad flattened carapace with a small ab-domen folded under the thorax and pincers(4)

3 and of several small active brown birds ofthe northern hemisphere with short up-right tails; they feed on insects (4)

2 any of various tailless stout-bodied am-phibians with long hind limbs for leaping;semiaquatic and terrestrial species (4)

4 a tame parrot (4)

Page 84: Generation of Themed Portable Crosswords A WordNet ... · PDF fileGeneration of Themed Portable Crosswords A WordNet Implementation ... not been submitted as an exercise for a degree

Themed Crossword: 8

EN

YFIRU6

A

5

DY

KLAH4

C

RL

OGIDN3

I

2

W1

O

ACROSS3 a blue dye obtained from plants or made

synthetically (6)4 a pure flat white with little reflectance (5)6 turn golden (6)

DOWN1 ******** paint used by an artist (3)4 a blue-green that is one of the primary pig-

ments (4)2 have and exert influence or effect; ‘The

artist’s ******** influenced the youngpainter’; ‘She ******** on her friends tosupport the political candidate’ (4)

5 a usually soluble substance for staining orcoloring e.g. fabrics or hair (3)

Page 85: Generation of Themed Portable Crosswords A WordNet ... · PDF fileGeneration of Themed Portable Crosswords A WordNet Implementation ... not been submitted as an exercise for a degree

Appendix C

5 Themed Crosswords: Blank

Themed Crossword: Country

6

5

43

21

ACROSS1 the capital and largest city of Zambia (6)3 a landlocked republic in northwestern

Africa; achieved independence fromFrance in 1960; ******** was a center ofWest African civilization for more than4,000 years (4)

5 a country of southeastern Asia that ex-tends southward along the Isthmus of Krato the Malay peninsula; ‘Thailand is theofficial name of the former ******** ’ (4)

6 a Scandinavian kingdom in the easternpart of the Scandinavian Peninsula (6)

DOWN1 a mountainous landlocked communist

state in southeastern Asia; achieved inde-pendence from France in 1949 (4)

3 the capital of Maldives in the center of theislands (4)

2 the biblical name for ancient Syria (4)4 a theocratic islamic republic in the Middle

East in western Asia; ******** was thecore of the ancient empire that was knownas Persia until 1935; rich in oil; involved instate-sponsored terrorism (4)

81

Page 86: Generation of Themed Portable Crosswords A WordNet ... · PDF fileGeneration of Themed Portable Crosswords A WordNet Implementation ... not been submitted as an exercise for a degree

Themed Crossword: Language

6

5

43

21

ACROSS1 the words of something written; ‘there

were more than a thousand words of******** ’; ‘they handed out the printed******** of the mayor’s speech’; ‘he wantsto reconstruct the original ******** ’ (4)

3 the language of the nomadic Lapp peo-ple in northern Scandinavia and the KolaPeninsula (4)

5 Kamarupan languages spoken in westernBurma and Bangladesh and easternmostIndia (4)

6 a family of American Indian languagesspoken by Mayan peoples (4)

DOWN1 the dialect of Albanian spoken in southern

Albania and in areas of Greece and Italy(4)

3 reading or glancing through quickly (4)2 a branch of the Tai languages (4)4 a dialect of the Chiwere language spoken

by the ******** people (4)

Page 87: Generation of Themed Portable Crosswords A WordNet ... · PDF fileGeneration of Themed Portable Crosswords A WordNet Implementation ... not been submitted as an exercise for a degree

Themed Crossword: Shape

8

76

54

3

21

ACROSS1 a round shape formed by a series of con-

centric circles (5)5 form a knot or bow in; ‘ ****** a necktie’

(3)6 a continuous portion of a circle (3)8 form metals with a swage (5)

DOWN4 an angular shape characterized by sharp

turns in alternating directions (3)7 form into the shape of a ****** ; ‘She

cupped her hands’ (3)2 a groove or furrow (especially one in soft

earth caused by wheels) (3)3 a part of a forked or branching shape; ‘he

broke off one of the branches’; ‘they tookthe south fork” (3)

Page 88: Generation of Themed Portable Crosswords A WordNet ... · PDF fileGeneration of Themed Portable Crosswords A WordNet Implementation ... not been submitted as an exercise for a degree

Themed Crossword: Fruit

5

4

3

21

ACROSS3 pod of the peanut vine containing usually

2 nuts or seeds; ‘groundnut’ and ‘monkeynut’ are British terms (6)

5 the small hard nutlet of a drupe or dru-pelet; the seed and the hard endocarp thatsurrounds it (6)

DOWN3 any of various juicy purple- or green-

skinned fruit of the genus Vitis; grow inclusters (5)

1 a several-seeded dehiscent fruit as e.g. ofa leguminous plant (3)

4 the fruit or seed of a ****** plant (3)2 dried plum (5)

Page 89: Generation of Themed Portable Crosswords A WordNet ... · PDF fileGeneration of Themed Portable Crosswords A WordNet Implementation ... not been submitted as an exercise for a degree

Themed Crossword: City

7

6

5

4

3

21

ACROSS1 a city in northwestern Iran; a place of pil-

grimage for Shiite Muslims (3)3 a city in the European part of Russia (3)4 a port in southern Lebanon on the

Mediterranean Sea; formerly a majorPhoenician seaport famous for silks (3)

5 the former capital and 2nd largest city ofBrazil; chief Brazilian port; famous as atourist attraction (3)

6 the capital and largest city of Japan; theeconomic and cultural center of Japan (3)

7 a city in north central Morocco; religiouscenter (3)

DOWN4 a city in northeastern Egypt at the head of

the Gulf of ******** and at the southernend of the ******** Canal (4)

2 a port in western Israel on the Mediter-ranean; incorporated into Tel Aviv in 1950(4)

Page 90: Generation of Themed Portable Crosswords A WordNet ... · PDF fileGeneration of Themed Portable Crosswords A WordNet Implementation ... not been submitted as an exercise for a degree

Appendix D

5 Themed Crosswords: Solution

Themed Crossword: Country

NEDEW6

S

AL

RMAI5

S

4

ILA3

MO

RA

AK2

ASU1

L

ACROSS1 the capital and largest city of Zambia (6)3 a landlocked republic in northwestern

Africa; achieved independence fromFrance in 1960; ******** was a center ofWest African civilization for more than4,000 years (4)

5 a country of southeastern Asia that ex-tends southward along the Isthmus of Krato the Malay peninsula; ‘Thailand is theofficial name of the former ******** ’ (4)

6 a Scandinavian kingdom in the easternpart of the Scandinavian Peninsula (6)

DOWN1 a mountainous landlocked communist

state in southeastern Asia; achieved inde-pendence from France in 1949 (4)

3 the capital of Maldives in the center of theislands (4)

2 the biblical name for ancient Syria (4)4 a theocratic islamic republic in the Middle

East in western Asia; ******** was thecore of the ancient empire that was knownas Persia until 1935; rich in oil; involved instate-sponsored terrorism (4)

Page 91: Generation of Themed Portable Crosswords A WordNet ... · PDF fileGeneration of Themed Portable Crosswords A WordNet Implementation ... not been submitted as an exercise for a degree

Themed Crossword: Language

AYA6

M

WI

OIKU5

K

4

IMA3

SS

HO

2

TXE1

T

ACROSS1 the words of something written; ‘there

were more than a thousand words of******** ’; ‘they handed out the printed******** of the mayor’s speech’; ‘he wantsto reconstruct the original ******** ’ (4)

3 the language of the nomadic Lapp peo-ple in northern Scandinavia and the KolaPeninsula (4)

5 Kamarupan languages spoken in westernBurma and Bangladesh and easternmostIndia (4)

6 a family of American Indian languagesspoken by Mayan peoples (4)

DOWN1 the dialect of Albanian spoken in southern

Albania and in areas of Greece and Italy(4)

3 reading or glancing through quickly (4)2 a branch of the Tai languages (4)4 a dialect of the Chiwere language spoken

by the ******** people (4)

Page 92: Generation of Themed Portable Crosswords A WordNet ... · PDF fileGeneration of Themed Portable Crosswords A WordNet Implementation ... not been submitted as an exercise for a degree

Themed Crossword: Shape

TESP8

U

UG

G7

CR6

A

EI5

T4

Z

3

LU

L2

ROH1

W

ACROSS1 a round shape formed by a series of con-

centric circles (5)5 form a knot or bow in; ‘ ****** a necktie’

(3)6 a continuous portion of a circle (3)8 form metals with a swage (5)

DOWN4 an angular shape characterized by sharp

turns in alternating directions (3)7 form into the shape of a ****** ; ‘She

cupped her hands’ (3)2 a groove or furrow (especially one in soft

earth caused by wheels) (3)3 a part of a forked or branching shape; ‘he

broke off one of the branches’; ‘they tookthe south fork’ (3)

Page 93: Generation of Themed Portable Crosswords A WordNet ... · PDF fileGeneration of Themed Portable Crosswords A WordNet Implementation ... not been submitted as an exercise for a degree

Themed Crossword: Fruit

AE

ENERY5

P

N4

PA

UDR

REBOO3

G

2

P1

P

ACROSS3 pod of the peanut vine containing usually

2 nuts or seeds; ‘groundnut’ and ‘monkeynut’ are British terms (6)

5 the small hard nutlet of a drupe or dru-pelet; the seed and the hard endocarp thatsurrounds it (6)

DOWN3 any of various juicy purple- or green-

skinned fruit of the genus Vitis; grow inclusters (5)

1 a several-seeded dehiscent fruit as e.g. ofa leguminous plant (3)

4 the fruit or seed of a ****** plant (3)2 dried plum (5)

Page 94: Generation of Themed Portable Crosswords A WordNet ... · PDF fileGeneration of Themed Portable Crosswords A WordNet Implementation ... not been submitted as an exercise for a degree

Themed Crossword: City

ZE7

FZ

OD6

E

OI5

RU

FRU4

S

AF3

U

2

YMU1Q

ACROSS1 a city in northwestern Iran; a place of pil-

grimage for Shiite Muslims (3)3 a city in the European part of Russia (3)4 a port in southern Lebanon on the

Mediterranean Sea; formerly a majorPhoenician seaport famous for silks (3)

5 the former capital and 2nd largest city ofBrazil; chief Brazilian port; famous as atourist attraction (3)

6 the capital and largest city of Japan; theeconomic and cultural center of Japan (3)

7 a city in north central Morocco; religiouscenter (3)

DOWN4 a city in northeastern Egypt at the head of

the Gulf of ******** and at the southernend of the ******** Canal (4)

2 a port in western Israel on the Mediter-ranean; incorporated into Tel Aviv in 1950(4)

Page 95: Generation of Themed Portable Crosswords A WordNet ... · PDF fileGeneration of Themed Portable Crosswords A WordNet Implementation ... not been submitted as an exercise for a degree

Appendix E

Developer & Installation Guide

E.1 Introduction

This appendix is dedicated to those who may wish to extend this project orrun this project on their own computer. Information regarding the installa-tion of all packages required for the successful execution of the program isprovided. Common errors and pitfalls are also given.

E.2 Packages - Installation & Configuration

The program currently runs on a Windows Platform. See chapter 3 forfurther information on the project’s compatibility with Linux platforms. Theinformation provided here is sufficient to get the program up and runningbut is by no means exhaustive.

E.2.1 EasyPHP

EasyPHP is a software package designed for windows. This package com-prises of an Apache Server, a MySQL database and full php language sup-port. Of relevance to this project is the Apache Server and the MySQLdatabase. The MySQL database hosts all databases exploited by the cross-word generator. The apache server facilitates communication between thecrossword generator, the database and the web interface.

• Source

EasyPHP can be downloaded from the EasyPHP website EasyPHP (2004).Installation documentation is provided. Of note is the location of the web di-

Page 96: Generation of Themed Portable Crosswords A WordNet ... · PDF fileGeneration of Themed Portable Crosswords A WordNet Implementation ... not been submitted as an exercise for a degree

APPENDIX E. DEVELOPER & INSTALLATION GUIDE 92

rectory in which all the program files should be saved: C:/Program Files/EasyPHP1-7/www. The server name is localhost. Further and more detailed informationcan be found in the httpd.conf file which comes with the software.

E.2.2 Java

The prinicipal programming language used in the development of the cross-word generator is Java. The Java installation comprises of a Java VirtualMachine technology and a Java Runtime Environment both of which facili-tate the compilation and execution of Java programs. A windows version ofJava must be installed.

• Source

The version of Java used in the development of this project is: Java(TM)2 Runtime Environment, Standard Edition (build 1.4.2 02b03). This is freelyavailable from Sun (2005). The full Java Development Kit is required. Notethat changing to a different version of Java (e.g. Java 5) could have a detri-mental effect on the crossword generator. See the Section E.2.3 for furtherdetails.

E.2.3 SICStus Prolog

SICStus Prolog is a Prolog development system. Its role in the project is fun-damental. Prolog is responsible for finding the solution set of words to satisfythe grid generated. See Graham (2003)) for further information. Communi-cation between SICStus and Java is achieved using the Java.Jasper package.Jasper is a bi-directional interface between Java and SICStus.

• Compatability

At present Jasper only works under the following system configurations:

• Windows:

– Java Development Kit 1.3.1

– Java Development Kit 1.2.2 & Java Development Kit 1.4.X areexpected to work

• Linux

– Java Development Kit 1.3.1

Page 97: Generation of Themed Portable Crosswords A WordNet ... · PDF fileGeneration of Themed Portable Crosswords A WordNet Implementation ... not been submitted as an exercise for a degree

APPENDIX E. DEVELOPER & INSTALLATION GUIDE 93

– Java Development Kit 1.4.1 is expected to work

– Java Developement Kit 1.5

As described in 3 serious difficulties arose during attempts to run thecrossword generator on Linux systems using both Java 1.5 and Java 1.4.2.

• Source

SICStus Prolog is available for downloading from the SICStus Prologwebsite (SICStus, 2004).

E.2.4 Adobe Reader 5

The Adobe Reader is free software that allows users to view, print and searchPDF files. (PDF: Portable Document Format). Its role in the project is tofacilitate the viewing of printable versions of the crossword generated as wellas the user help file.

• Source

The Adobe Reader is available from the Adobe site (Adobe, 2005). Theversion used in this project is version 5. Using more recent versions of Adobewill not adversely effect the crossword generator.

E.2.5 LATEX

LATEX is a document preparation system. Its features are described in detailin Section 7.2.1. LaTeX facilitates the developement of PDF files of thecrossword generated by the applet. This tool is available from the LaTeXsite (LaTeX, 2004).

• Source

A windows version of LATEX is downloadable @ http://www.miktex.org/.The installation must include the crosswrd.sty file. This file is central to thecreation of dvi and PDF files.

Page 98: Generation of Themed Portable Crosswords A WordNet ... · PDF fileGeneration of Themed Portable Crosswords A WordNet Implementation ... not been submitted as an exercise for a degree

APPENDIX E. DEVELOPER & INSTALLATION GUIDE 94

E.3 Setting of Classpaths

In order for each of the above packages to function effectively, classpathspointing to certain aspects of each the packages must be set. The procedureto set classpaths for each of the packages on Windows XP follows.

• Start

• Control Panel

• System icon

• Advanced tab

• Environment Variables button

• System Variables frame

• Click on ’classpath’

• Click Edit

• Append each of the following strings separated by a semi-colon to anyexisting strings:

- C:\texmf\miktex\bin

- C:\j2sdk1.4.2 02\bin

- C:\Program Files\SICStus Prolog 3.12.0\bin

- C:\Program Files\SICStus Prolog 3.12.0\se\sics\jasper

- C:\Program Files\Adobe\Acrobat 5.0\Reader

• Restart the system in order for the changes to take effect

Note that the classpaths above refer to the versions of the packages usedin the current configuration and should be used as a guide with respect tofuture installations/configurations. Note also that LATEX generally sets itsenvironmental variables during installation but that they only take effectafter restarting the system.

Page 99: Generation of Themed Portable Crosswords A WordNet ... · PDF fileGeneration of Themed Portable Crosswords A WordNet Implementation ... not been submitted as an exercise for a degree

Appendix F

User Help File

F.1 Introduction

This guide aims to maximise the users use of the Crossword Generator. At-tention is paid to all functional aspects of the program.

95

Page 100: Generation of Themed Portable Crosswords A WordNet ... · PDF fileGeneration of Themed Portable Crosswords A WordNet Implementation ... not been submitted as an exercise for a degree

APPENDIX F. USER HELP FILE 96

F.2 Crossword Generation

F.2.1 WordNet2

Introduction

The WordNet2 database is a lexical database for the English language. Thisresource is was selected for the convenient way in which words related to aspecific theme is returned to the user.

Theme Selection

Due to relational aspects of the database only singular nouns and verbs maybe entered as a theme - other parts of speech will result in no crosswordsbeing generated.

Improving Success Rates

1. If the information panel indicates that there was not enough words inthe database to fill the grid, try reducing the size of the grid.

2. If the information panel indicates that no solution could be found forthe grid, try increasing the difficulty level, as this reduces the numberof words that appear in the grid and reduces the number of interlockingsolutions, hence making the problem of finding a solution set easier tosolve.

F.2.2 Websters Unabridged Dictionary

Introduction

This dictionary dates from the early 20th century and hence contains manyold and obsolete expressions. It’s most impressive function is the productionof random crosswords that are not related to a particular theme

Theme Selection

It is advisable to use the WordNet2 database for the generation of themedcrosswords. Leaving the subject field blank will result in the production ofa non-themed crossword.

Page 101: Generation of Themed Portable Crosswords A WordNet ... · PDF fileGeneration of Themed Portable Crosswords A WordNet Implementation ... not been submitted as an exercise for a degree

APPENDIX F. USER HELP FILE 97

F.2.3 User Database

Introduction

These are databases added to the program by users. The database namesgenerally describe their contents.

Exploitation of Database

Themed crosswords cannot be generated for user databases. User databasescreate general crosswords. The entire database is queried for words whoselength correspond with the requirements of the grid. The subject field shouldbe left blank - no input is required.

Improving Success Rates

Whether a crossword is generated or not depends on the size of the databaseand the size of the grid. Larger databases will stand a greater chance ofproducing enough words for a 7x7 grid than smaller databases.

1. If the information panel indicates that there was not enough words inthe database to fill the grid, try reducing the size of the grid.

2. Alternatively try adding more words to the database

3. If the information panel indicates that no solution could be found forthe grid, try increasing the difficulty level, as this reduces the numberof words that appear in the grid and reduces the number of interlockingsolutions, hence making the problem of finding a solution set easier tosolve.

Page 102: Generation of Themed Portable Crosswords A WordNet ... · PDF fileGeneration of Themed Portable Crosswords A WordNet Implementation ... not been submitted as an exercise for a degree

APPENDIX F. USER HELP FILE 98

F.3 Uploading Databases

F.3.1 Introduction

Databases can be uploaded to the program while the program is running.These databases are then available as a resource to the program. Particularattention should be paid to their content and size. Results will be poor ifthe database is small and contains little variety of word length. Uploadeddatabases can be accessed from the drop down database menu until they areremoved from the system.

F.3.2 Text File Format

Structure of text file

The text file contains the information that will be interpreted by the program.This information is converted to a MySql database. Each line of the text filecontains a separate piece of information. The first line of the file will containa word, the next line in the file will contain that word’s definition. Note thatfor words with multiple definitions there must be a separate word-definitionpair for each definition.

Location of text file

The user is prompted for the location of the text file. The explicit path mustbe provided. That means including drive name, folder name and the nameof the file. For example

- C:/Database/My Database Files/frenchdatabase.txt

Failing to enter the exact location of the file will result in an error messagebeing displayed and the process will come to an end.

F.3.3 Database Format

Entire databases can be passed to the system. The location of the data-base must be given explicitly. Field names are altered automatically to suitthe system.

Page 103: Generation of Themed Portable Crosswords A WordNet ... · PDF fileGeneration of Themed Portable Crosswords A WordNet Implementation ... not been submitted as an exercise for a degree

APPENDIX F. USER HELP FILE 99

F.4 Changing Passwords

F.4.1 How to?

Passwords can only be changed by the superuser - that is an individualwho has full access privileges to the MySql database running on the server.This database is independant of the system. The following MySql command,when run in the MySql environment, updates the password:

- UPDATE password IN PASSWORDS WHERE user = ’teacher’;

Page 104: Generation of Themed Portable Crosswords A WordNet ... · PDF fileGeneration of Themed Portable Crosswords A WordNet Implementation ... not been submitted as an exercise for a degree

APPENDIX F. USER HELP FILE 100

F.5 Creating Printable Versions of Crosswords

Two options are avaiable:

• Print Crossword with solution

• Print Crossword with blank grid

These options can be selected from the drop down menu on the interface.Confirm option choice by clicking on ”Create PDF”. Submit a suitable file-name and keep for further reference.

F.5.1 Viewing Crosswords

Crosswords generated and saved to server can be viewed by clicking onthe ”View PDF” button. Next the user is prompted for the filename of thecrossword desired. Remember to include the .pdf extension. If thefilename is animal the complete filename is animal.pdf

Adobe Acrobat Reader is required to view the crosswords.