#!/usr/bin/python
# -*- coding: utf-8 -*-

import logging

from interpretation.statements_builder import StatementBuilder

"""This module implements ...

"""

class ContentAnalyser:
    def __init__(self):
        self.builder = StatementBuilder()
        
    def analyse(self, sentence, current_speaker):
        if sentence.data_type == 'imperative':
            logging.debug("Processing the content of an imperative sentence")
            return self.process_order(sentence, current_speaker)
            
    def process_order(self, sentence, current_speaker):
        flags = ['order', '', '', '', '', '', []]
        stmts = self.builder.processOrderSentence(
                            sentence, 
                            current_speaker, 
                            flags)
        logging.info("Generated statements: ")
        for s in stmts:
            logging.info(">> " + s)
        
        return stmts

def unit_tests():
    """This function tests the main features of the class ContentAnalysis"""
    print("This is a test...")

if __name__ == '__main__':
    unit_tests()

@@ -292,32 +292,87 @@
 rrent_speaker):%0A
+        %22%22%22analyse an imperative data_type sentence%22%22%22%0A
         if sente
@@ -402,16 +402,16 @@
 ative':%0A
-
         
@@ -544,16 +544,272 @@
 speaker)
+%0A%0A%09%0A        %22%22%22analyse a statement data_type sentence%22%22%22%0A        if sentence.data_type == 'statement':%0A            logging.debug(%22Processing the content of a statement type sentence%22)%0A            return self.process_statement(sentence, current_speaker)%0A%09%0A%0A
 %0A       
@@ -915,16 +915,20 @@
  '', '',
+ %5B%5D,
  %5B%5D%5D%0A   
@@ -1207,24 +1207,24 @@
 s)%0A        %0A
-
         retu
@@ -1233,16 +1233,447 @@
  stmts%0A%0A
+%0A    def process_statement(self, sentence, current_speaker):%0A        flags = %5B'inform', '', '', '', '', '', %5B%5D, %5B%5D%5D%0A        stmts = self.builder.processSentence(%0A                            sentence,%0A                            current_speaker,%0A                            flags)%0A        logging.info(%22Generated statements: %22)        %0A        for s in stmts:%0A            logging.info(%22%3E%3E %22 + s)%0A        %0A        return stmts%0A    %0A%0A
 def unit

processing statement data_type sentence