Пример #1
0
	    /**
	     * Realise.
	     * 
	     * @param wt
	     *            the wt
	     * @return the string
	     * @throws XMLRealiserException
	     *             the xML realiser exception
	     */
		public static string realise(wrapper.XmlDocumentElement wt)
		{
			string output = "";
			if (wt != null)
			{
				try
				{
					if (lexicon == null)
					{
						lexicon = Lexicon.DefaultLexicon;
					}
					UnWrapper w = new UnWrapper(lexicon);
					DocumentElement t = w.UnwrapDocumentElement(wt);
					if (t != null)
					{
						Realiser r = new Realiser(lexicon);
						r.initialise();

						NLGElement tr = r.realise(t);

						output = tr.Realisation;
					}

				}
				catch (Exception e)
				{
					throw new XMLRealiserException("NLG XMLRealiser Error", e);
				}
			}

			return output;
		}
Пример #2
0
	    /**
	     * Gets the request.
	     * 
	     * @param input
	     *            the input
	     * @return the request
	     * @throws XMLRealiserException
	     *             the xML realiser exception
	     */
		public static wrapper.RequestType getRequest(StringReader input)
		{
			wrapper.NLGSpec spec = UnWrapper.getNLGSpec(input);
			wrapper.RequestType request = spec.Request;
			if (request == null)
			{
				throw new XMLRealiserException("Must have Request element");
			}

			return request;
		}
Пример #3
0
	    /**
	     * Gets the recording.
	     * 
	     * @param input
	     *            the input
	     * @return the recording
	     * @throws XMLRealiserException
	     *             the xML realiser exception
	     */
		public static wrapper.RecordSet getRecording(StringReader input)
		{
			wrapper.NLGSpec spec = UnWrapper.getNLGSpec(input);
			wrapper.RecordSet recording = spec.Recording;
			if (recording == null)
			{
				throw new XMLRealiserException("Must have Recording element");
			}

			return recording;

		}