/*
 * Copyright 2008 Novamente LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package relex;

import java.io.Serializable;
import java.util.ArrayList;

import relex.feature.Atom;

/**
 * The Document class stores a sequence of Sentence objects.
 * It is primarily useful for any post-processing steps, anthing
 * that needs to obtain access multiple sentences at a time.
 *
 */
public class Document extends Atom implements Serializable
{
	private static final long serialVersionUID = -4518792541801263127L;

	// Unique ID string identifying this document.
	private String idString;

	// Sequence of sentences
	private ArrayList<Sentence> sentences;

	/* -------------------------------------------------------------------- */
	/* Constructors, and setters/getters for private members. */
	// Constructor.
	public Document()
	{
		sentences = null;
	}

	public String getIDString()
	{
		return idString;
	}

	public void setIDString(String str)
	{
		idString = str;
	}

	public void addSentence(Sentence sntc)
	{
		sentences.add(sntc);
	}

} // end Document

@@ -663,16 +663,39 @@
 rayList;
+%0Aimport java.util.UUID;
 %0A%0Aimport
@@ -1388,61 +1388,215 @@
 ll;%0A
-%09%7D%0A%0A%09public String getIDString()%0A%09%7B%0A%09%09return idString
+%0A%09%09// Assign a unique document ID to each document;%0A%09%09// this is required for OpenCog output, where each%0A%09%09// document and needs to be tagged.%0A%09%09UUID guid = UUID.randomUUID();%0A%09%09idString = %22document_%22 + guid
 ;%0A%09%7D
@@ -1609,14 +1609,16 @@
 lic 
-void s
+String g
 etID
@@ -1628,33 +1628,30 @@
 ing(
-String str
 )%0A%09%7B%0A%09%09
+return 
 idString
  = s
@@ -1650,14 +1650,8 @@
 ring
- = str
 ;%0A%09%7D

add a unique document ID number.