calculate height, width and breadth of a object Primary Question

I need to somehow place 3d objects besides one another using python script or command line 



Secondary Info Optional Reading

I am creating a project named "text to scene" where user can enter a sentence and the output will a complete scene rendered using blender. I've completed the initial phase using NLP but for the later stages of the project I need to somehow place objects in blender as needed or directed by the user in the sentence. I've stored all the data (regarding the objects) but I can't find a method to apply it in blender(or any other 3d modeling and rendering software).

So I basically have to

1). import objects into blender(can be achieved using python script)

2). find their dimensions(length, breadth, height)

3). place other objects relative to the dimensions of the root object

EXAMPLE :

INPUT: "A vase is on the table."

WORKING: (Skipping the initial NLP part) First import 3d model of "TABLE" into blender then calculate its height, width, length and then place a model of "VASE" above the specified height at the center of the top face of the table.

OUTPUT: 3D scene in blender
Location and Dimension



In the image above is the Blender 3D View.  The information panel shows by pressing the letter [N] ... N.  The location and Dimension are shown.  The tooltip shows the Python expression for the dimension. Click on image to see original larger size. 

This is not the whole story.  Know that object origins can be moved anywhere for your convenience or not.

Just a quick example of querying an text object. Example from another question.  Inspect and improve.  The blue objects are placed at x-axis rights side of characters.



Click on image to see larger version.



The console window of Blender.  Multiple queries.  After each Python statement I have edited text to add a character in the Blender 3D View edit mode.  Note the increasing X dimension for languages like English, French, Spanish (left to right and top to bottom) with left justified text.