Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
18 lines (16 sloc) 453 Bytes
require 'java'
class Api::RealisersController < ApplicationController
def create
reader = java::io::StringReader.new(params[:xml])
begin
records = SimpleNLG::XMLRealiser.getRecording(reader)
output = records.getRecord.map do |record|
SimpleNLG::XMLRealiser.realise(record&.getDocument)
end
@realisation = output.join("\n").strip
render plain: @realisation
ensure
reader.close
end
end
end
You can’t perform that action at this time.