Skip to content
This repository was archived by the owner on Jun 24, 2024. It is now read-only.

Commit 7bf0659

Browse files
committed
updated project properties, added logo image, fixed script loading
mechanism
1 parent 4af3858 commit 7bf0659

8 files changed

Lines changed: 42 additions & 102 deletions

File tree

.project

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<projectDescription>
3-
<name>eliza</name>
3+
<name>Eliza</name>
44
<comment></comment>
55
<projects>
66
</projects>

README.md

Lines changed: 27 additions & 85 deletions
Original file line numberDiff line numberDiff line change
@@ -1,100 +1,42 @@
1-
The following describes how to set up a Processing library project in Eclipse and build it successfully, and to make your library ready for distribution.
1+
Eliza is a port as a Processing library of the Java implementation of the Eliza program by Charles Hayden.
2+
Hayden's code is a complete and faithful implementation of the original program described by by Joseph Weizenbaum in Communications of the ACM in January 1966.
23

3-
## Import to Eclipse
4+
ACKNOWLEDGMENTS
45

5-
There are two options to import the template project into Eclipse: using a Git [fork](https://help.github.com/articles/fork-a-repo) or using a downloaded package. If you are not familiar with Git or GitHub, you should opt for the downloaded package.
6+
1) Charles Hayden's Java implementation of Eliza:
7+
http://chayden.net/eliza/Eliza.html
68

7-
### Option A: GitHub
9+
2) Processing Library Template:
10+
https://github.com/processing/processing-library-template
811

9-
1. Fork the template repository to use as a starting point.
10-
* Navigate to https://github.com/processing/processing-library-template in your browser.
11-
* Click the "Fork" button in the top-right of the page.
12-
* Once your fork is ready, open the new repository's "Settings" by clicking the link in the menu bar on the right.
13-
* Change the repository name to the name of your library and save your changes.
14-
* NOTE: GitHub only allows you to fork a project once. If you need to create multiple forks, you can follow these [instructions](http://adrianshort.org/2011/11/08/create-multiple-forks-of-a-github-repo/).
15-
1. Clone your new repository to your Eclipse workspace.
16-
* Open Eclipse and select the File → Import... menu item.
17-
* Select Git → Projects from Git, and click "Next >".
18-
* Select "URI" and click "Next >".
19-
* Enter your repository's clone URL in the "URI" field. The remaining fields in the "Location" and "Connection" groups will get automatically filled in.
20-
* Enter your GitHub credentials in the "Authentication" group, and click "Next >".
21-
* Select the `master` branch on the next screen, and click "Next >".
22-
* The default settings on the "Local Configuration" screen should work fine, click "Next >".
23-
* Make sure "Import existing projects" is selected, and click "Next >".
24-
* Eclipse should find and select the `processing-library-template` automatically, click "Finish".
25-
1. Rename your Eclipse project.
26-
* In the Package Explorer, right-click (ctrl-click) on the folder icon of the `processing-library-template` project, and select Refactor → Rename... from the menu that pops up.
27-
* Give the project the name of your library, and click "OK".
28-
29-
### Option B: Downloaded Package
12+
INSTRUCTIONS
3013

31-
1. Download the latest Eclipse template from [here](https://github.com/processing/processing-library-template/releases). **Don't unzip the ZIP file yet.**
32-
1. Create a new Java project in Eclipse.
33-
* From the menubar choose File → New → Java Project.
34-
* Give the project the name of your library.
35-
* Click "Finish".
36-
1. Import the template source files.
37-
* Right-click (ctrl-click) onto the folder icon of your newly created project in the Package Explorer and select "Import..." from the menu that pops up.
38-
* Select General → Archive File, and click "Next >".
39-
* Navigate to the ZIP file you downloaded earlier in step 1, and click "Finish".
14+
The library is easy to use. Just import it, and then create an Eliza object:
4015

41-
## Set Up and Compile
16+
import codeanticode.eliza.*;
4217

43-
1. Add Processing to the project build path.
44-
* Open your project's "Properties" window.
45-
* Under "Java Build Path", select the "Libraries" tab and then "Add External JARs...".
46-
* Locate and add Processing's `core.jar` to your build path. It is recommended that a copy of `core.jar` is located in your Eclipse workspace in a `libs` folder. If the `libs` folder does not exist yet, create it. Read the [section below](#AddingJARs) regarding where to find the `core.jar` file.
47-
* Confirm the setup with "OK".
48-
1. Edit the library properties.
49-
* Open the `resources` folder inside of your Java project and double-click the `build.properties` file. You should see its contents in the Eclipse editor.
50-
* Edit the properties file, making changes to items 1-4 so that the values and paths are properly set for your project to compile. A path can be relative or absolute.
51-
* Make changes to items under 5. These are metadata used in the automatically generated HTML, README, and properties documents.
52-
1. Compile your library using Ant.
53-
* From the menu bar, choose Window → Show View → Ant. A tab with the title "Ant" will pop up on the right side of your Eclipse editor.
54-
* Drag the `resources/build.xml` file in there, and a new item "ProcessingLibs" will appear.
55-
* Press the "Play" button inside the "Ant" tab.
56-
1. BUILD SUCCESSFUL. The library template will start to compile, control messages will appear in the console window, warnings can be ignored. When finished it should say BUILD SUCCESSFUL. Congratulations, you are set and you can start writing your own library by making changes to the source code in folder `src`.
57-
1. BUILD FAILED. In case the compile process fails, check the output in the console which will give you a closer idea of what went wrong. Errors may have been caused by
58-
* Incorrect path settings in the `build.properties` file.
59-
* Error "Javadoc failed". if you are on Windows, make sure you are using a JDK instead of a JRE in order to be able to create the Javadoc for your library. JRE does not come with the Javadoc application, but it is required to create libraries from this template.
18+
```java
19+
Eliza eliza;
20+
eliza = new Eliza(this);
6021

61-
After having compiled and built your project successfully, you should be able to find your library in Processing's sketchbook folder, examples will be listed in Processing's sketchbook menu. Files that have been created for the distribution of the library are located in your Eclipse's `workspace/yourProject/distribution` folder. In there you will also find the `web` folder which contains the documentation, a ZIP file for downloading your library, a folder with examples as well as the `index.html` and CSS file.
22+
String response = eliza.processInput(“Hello”);
23+
println(response);
24+
```
6225

63-
To distribute your library please refer to the [Library Guidelines](https://github.com/processing/processing/wiki/Library-Guidelines).
26+
You can use the readScript() function to change the script that Eliza uses to construct its answers:
6427

65-
## Source code
28+
```java
29+
eliza.readScript(“script”);
30+
eliza.readScript(“http://chayden.net/eliza/script");
31+
```
6632

67-
If you want to share your library's source code, we recommend using an online repository available for free at [Google Code] (http://code.google.com) or [GitHub](https://github.com/).
33+
To go back to the default script that is loaded when Eliza is initialized, call the readDefaultScript() function.
6834

69-
## <a name='AddingJARs'/>Adding core.jar and other .jar files to your classpath</a>
35+
http://chayden.net/eliza/instructions.txt
7036

71-
The `core.jar` file contains the core classes of Processing and has to be part of your classpath when building a library. On Windows and Linux, this file is located in the Processing distribution folder inside a folder named `lib`. On Mac OS X, right-click the Processing.app and use "Show Package Contents" to see the guts. The `core.jar` file is inside Contents → Resources → Java. For further information about the classes in `core.jar`, you can see the source [here](http://code.google.com/p/processing/source/browse/trunk/processing#processing/core) and the developer documentation [here](http://processing.googlecode.com/svn/trunk/processing/build/javadoc/core/index.html).
37+
FURTHER REFERENCES
7238

73-
If you created a `libs` folder as described above, put the libraries you need to add to your classpath in there. In the "Properties" of your Java project, navigate to Java Build Path → Libraries, and click "Add External JARs...". Select the `.jar` files from the `libs` folder that are required for compiling your project. Adjust the `build.xml` file accordingly.
39+
1) Wikipedia article about Eliza: http://en.wikipedia.org/wiki/ELIZA
7440

75-
The `libs` folder is recommended but not a requirement, nevertheless you need to specify where your `.jar` files are located in your system in order to add them to the classpath.
76-
77-
In case a library depends on system libraries, put these dependencies next to the `.jar` file. For example, Processing's `opengl.jar` library depends on JOGL hence the DLLs (for Windows) or jnilibs (for OS X) have to be located next to the `opengl.jar` file.
78-
79-
## What is the difference between JDK and JRE?
80-
81-
JDK stands for Java Development Kit whereas JRE stands for Java Runtime Environment. For developers it is recommended to work with a JDK instead of a JRE since more Java development related applications such as Javadoc are included. Javadoc is a requirement to properly compile and document a Processing library as described on the guidelines page.
82-
83-
You can have both a JDK and a JRE installed on your system. In Eclipse you need to specify which one you want to use.
84-
85-
## The JRE System Library
86-
87-
This primarily affects Windows and Linux users (because the full JDK is installed by default on Mac OS X). It is recommended that you use the JDK instead of a JRE. The JDK can be downloaded from [Oracle's download site](http://www.oracle.com/technetwork/java/javase/downloads/index.html). Also see the [Java Platform Installation page](http://www.oracle.com/technetwork/java/javase/index-137561.html), which contains useful information.
88-
89-
To change the JRE used to compile your Java project:
90-
91-
1. Open the properties of your project from the menu Project → Properties. Select "Java Build Path" and in its submenu, click on the "Libraries" tab.
92-
1. A list of JARs and class folders in the build path will show up. In this list you can find the JRE System Library that is used to compile your code. Remove this JRE System library.
93-
1. Click "Add Library...". In the popup window, choose "JRE System Library" and press "Next".
94-
1. Select an alternate JRE from the pull-down menu or click and modify the "Installed JREs". Confirm with "Finish" and "OK".
95-
96-
## Compiling with Ant and javadoc
97-
98-
Ant is a Java-based build tool. For [more information](http://ant.apache.org/faq.html#what-is-ant) visit the [Ant web site](http://ant.apache.org/). Ant uses a file named `build.xml` to store build settings for a project.
99-
100-
Javadoc is an application that creates an HTML-based API documentation of Java code. You can check for its existence by typing `javadoc` on the command line. On Mac OS X, it is installed by default. On Windows and Linux, installing the JDK will also install the Javadoc tool.
41+
2) Article from the Jul-Aug 1977 issue of the Creative Computing magazine, with a complete listing in Altair BASIC of a version of Eliza by Jeff Schrager:
42+
http://vintagecomputer.net/cisc367/Creative%20Computing%20Jul-Aug%201977%20Eliza%20BASIC%20listing.pdf

license.txt

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
1-
A code template to build libraries for the Processing programming environment.
1+
Eliza library
22

3-
Part of the Processing project - http://processing.org
4-
5-
Copyright (c) 2011-12 Elie Zananiri
6-
Copyright (c) 2008-11 Andreas Schlegel
3+
Copyright (c) 2007-13 Andres Colubri
74

85
This program is free software; you can redistribute it and/or
96
modify it under the terms of the GNU General Public License

resources/build.properties

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -72,11 +72,11 @@ ant.description=ProcessingLibs Ant build file.
7272
# Project details.
7373
# Give your library a name. The name must not contain spaces or special characters.
7474

75-
project.name=eliza
75+
project.name=Eliza
7676

7777
# The name as the user will see it. This can contain spaces and special characters.
7878

79-
project.prettyName=eliza
79+
project.prettyName=Eliza
8080

8181

8282
# Use 'normal' or 'fast' as value for project.compile.
@@ -140,7 +140,7 @@ library.paragraph=Based on the <a href="http://chayden.net/eliza/Eliza.html">Jav
140140
# Recommendations for storing your source code online are Google Code or GitHub.
141141

142142
source.host=GitHub
143-
source.url=https://github.com/codeanticode/eliza
143+
source.url=https://github.com/
144144
source.repository=https://github.com/codeanticode/eliza
145145

146146

@@ -157,7 +157,7 @@ library.version=1
157157
library.prettyVersion=1.0.0
158158

159159

160-
library.copyright=(c) 2013
160+
library.copyright=(c) 2007-13
161161
library.dependencies=
162162
library.keywords=eliza, chatbot, AI, natural language
163163

resources/build.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<project name="eliza" default="clean" basedir="../">
1+
<project name="Eliza" default="clean" basedir="../">
22

33

44
<!--

src/codeanticode/eliza/Eliza.java

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -169,9 +169,6 @@ public String processInput(String s) {
169169

170170
public boolean readDefaultScript() {
171171
clearScript();
172-
173-
URL url = this.getClass().getResource("eliza.script");
174-
System.out.println(url);
175172

176173
/*
177174
// Returns the URL of the resource file inside the location in the jar

web/index.html

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,12 @@
2020
<div id="container">
2121

2222
<div id="header">
23+
<tr>
24+
<td style="text-align: center;" colspan="2" height="127"><img style="width: 843px; height: 130px;" alt=""
25+
src="logo.jpg">
26+
</td>
27+
</tr>
28+
<br/><br/>
2329
<h1>##library.name##</h1>
2430
</div>
2531

@@ -46,9 +52,7 @@ <h2>##library.name##</h2>
4652
</p>
4753
<p>
4854
##library.sentence##<br>
49-
##library.paragraph##<br>
50-
Feel free to replace this paragraph with a description of the library.<br>
51-
Contributed libraries are developed, documented, and maintained by members of the Processing community. Further directions are included with each library. For feedback and support, please post to the Discourse. We strongly encourage all libraries to be open source, but not all of them are.
55+
##library.paragraph##<br>
5256
</p>
5357
</div>
5458

web/logo.jpg

41.5 KB
Loading

0 commit comments

Comments
 (0)