/*
 * 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.
 */
/*
 * @author miross
 * Created on Mar 29, 2005
 */
package relex;

import java.io.Serializable;
import java.util.ArrayList;
import relex.output.SimpleView;

/**
 * This class encapsulates information about an input sentence
 * which is generated by Relex.  
 */
public class RelexInfo implements Serializable
{
	private static final long serialVersionUID = -3047552550351161106L;
	
	public String originalSentence;
	public ArrayList<ParsedSentence> parsedSentences;
	
	public RelexInfo(String _originalSentence, 
	                 ArrayList<ParsedSentence> _parsedSentences)
	{
		originalSentence = _originalSentence;
		parsedSentences = _parsedSentences;

		int n = 0;
		for (ParsedSentence parse: parsedSentences)
		{
			String id = "parse_" + n;
			parse.setIDString(id);
			n++;
		}
	}
	
	public String toString()
	{
		StringBuilder sb = new StringBuilder();
		int numParses = 0;
		for (ParsedSentence parse: parsedSentences)
		{
			sb.append("Parse " + ((numParses++)+1) + 
			          " of " + parsedSentences.size()).append("\n");
			sb.append(SimpleView.printRelations(parse)).append("\n");
		}
		return sb.toString();
	}
}


@@ -715,16 +715,40 @@
 ayList;%0A
+import java.util.UUID;%0A%0A
 import r
@@ -1080,16 +1080,45 @@
 ntences;
+%0A%0A%09private String sentenceID;
 %0A%09%0A%09publ
@@ -1301,16 +1301,234 @@
 ences;%0A%0A
+%09%09// Assign a unique sentence ID to each sentence; this is required%0A%09%09// for OpenCog output, where each sentence and parse needs to be %0A%09%09// tagged.%0A%09%09UUID guid = UUID.randomUUID();%0A%09%09sentenceID = %22sentence_%22 + guid;%0A%0A
 %09%09int n 
@@ -1596,18 +1596,32 @@
 ing id =
+ sentenceID +
  %22
+_
 parse_%22 
@@ -1665,16 +1665,67 @@
 ;%0A%09%09%7D%0A%09%7D
+%0A%0A%09public String getID()%0A%09%7B%0A%09%09return sentenceID;%0A%09%7D
 %0A%09%0A%09publ

add a sentence-ID tag.