import traceback
from routes import Mapper

import ppp_core
import example_ppp_module as flower
import ppp_questionparsing_grammatical as qp_grammatical
import ppp_cas
#import ppp_nlp_ml_standalone

class Application:
    def __init__(self):
        self.mapper = Mapper()
        self.mapper.connect('core', '/core/', app=ppp_core.app)
        self.mapper.connect('qp_grammatical', '/qp_grammatical/', app=qp_grammatical.app)
        self.mapper.connect('flower', '/flower/', app=flower.app)
        self.mapper.connect('cas', '/cas/', app=ppp_cas.app)
        self.mapper.connect('spellcheck', '/spell_checker/', app=ppp_cas.app)
        #self.mapper.connect('nlp_ml_standalone', '/nlp_ml_standalone/', app=ppp_nlp_ml_standalone.app)

    def __call__(self, environ, start_response):
        match = self.mapper.routematch(environ=environ)
        app = match[0]['app'] if match else self.not_found
        try:
            return app(environ, start_response)
        except KeyboardInterrupt:
            raise
        except Exception as e:
            traceback.print_exc(e)

    def not_found(self, environ, start_response):
        headers = [('Content-Type', 'text/plain')]
        start_response('404 Not Found', headers)
        return [b'Not found.']

app = Application()

import traceback
from routes import Mapper

import ppp_core
import example_ppp_module as flower
import ppp_questionparsing_grammatical as qp_grammatical
import ppp_cas
import ppp_spell_checker
#import ppp_nlp_ml_standalone

class Application:
    def __init__(self):
        self.mapper = Mapper()
        self.mapper.connect('core', '/core/', app=ppp_core.app)
        self.mapper.connect('qp_grammatical', '/qp_grammatical/', app=qp_grammatical.app)
        self.mapper.connect('flower', '/flower/', app=flower.app)
        self.mapper.connect('cas', '/cas/', app=ppp_cas.app)
        self.mapper.connect('spellcheck', '/spell_checker/', app=ppp_spell_checker.app)
        #self.mapper.connect('nlp_ml_standalone', '/nlp_ml_standalone/', app=ppp_nlp_ml_standalone.app)

    def __call__(self, environ, start_response):
        match = self.mapper.routematch(environ=environ)
        app = match[0]['app'] if match else self.not_found
        try:
            return app(environ, start_response)
        except KeyboardInterrupt:
            raise
        except Exception as e:
            traceback.print_exc(e)

    def not_found(self, environ, start_response):
        headers = [('Content-Type', 'text/plain')]
        start_response('404 Not Found', headers)
        return [b'Not found.']

app = Application()

Fix name of spell checker.
Fix name of spell checker.

  import traceback
  from routes import Mapper
  
  import ppp_core
  import example_ppp_module as flower
  import ppp_questionparsing_grammatical as qp_grammatical
  import ppp_cas
+ import ppp_spell_checker
  #import ppp_nlp_ml_standalone
  
  class Application:
      def __init__(self):
          self.mapper = Mapper()
          self.mapper.connect('core', '/core/', app=ppp_core.app)
          self.mapper.connect('qp_grammatical', '/qp_grammatical/', app=qp_grammatical.app)
          self.mapper.connect('flower', '/flower/', app=flower.app)
          self.mapper.connect('cas', '/cas/', app=ppp_cas.app)
-         self.mapper.connect('spellcheck', '/spell_checker/', app=ppp_cas.app)
+         self.mapper.connect('spellcheck', '/spell_checker/', app=ppp_spell_checker.app)
          #self.mapper.connect('nlp_ml_standalone', '/nlp_ml_standalone/', app=ppp_nlp_ml_standalone.app)
  
      def __call__(self, environ, start_response):
          match = self.mapper.routematch(environ=environ)
          app = match[0]['app'] if match else self.not_found
          try:
              return app(environ, start_response)
          except KeyboardInterrupt:
              raise
          except Exception as e:
              traceback.print_exc(e)
  
      def not_found(self, environ, start_response):
          headers = [('Content-Type', 'text/plain')]
          start_response('404 Not Found', headers)
          return [b'Not found.']
  
  app = Application()
  
Fix name of spell checker.
## Code Before:
import traceback
from routes import Mapper

import ppp_core
import example_ppp_module as flower
import ppp_questionparsing_grammatical as qp_grammatical
import ppp_cas
#import ppp_nlp_ml_standalone

class Application:
    def __init__(self):
        self.mapper = Mapper()
        self.mapper.connect('core', '/core/', app=ppp_core.app)
        self.mapper.connect('qp_grammatical', '/qp_grammatical/', app=qp_grammatical.app)
        self.mapper.connect('flower', '/flower/', app=flower.app)
        self.mapper.connect('cas', '/cas/', app=ppp_cas.app)
        self.mapper.connect('spellcheck', '/spell_checker/', app=ppp_cas.app)
        #self.mapper.connect('nlp_ml_standalone', '/nlp_ml_standalone/', app=ppp_nlp_ml_standalone.app)

    def __call__(self, environ, start_response):
        match = self.mapper.routematch(environ=environ)
        app = match[0]['app'] if match else self.not_found
        try:
            return app(environ, start_response)
        except KeyboardInterrupt:
            raise
        except Exception as e:
            traceback.print_exc(e)

    def not_found(self, environ, start_response):
        headers = [('Content-Type', 'text/plain')]
        start_response('404 Not Found', headers)
        return [b'Not found.']

app = Application()

## Instruction:
Fix name of spell checker.
## Code After:
import traceback
from routes import Mapper

import ppp_core
import example_ppp_module as flower
import ppp_questionparsing_grammatical as qp_grammatical
import ppp_cas
import ppp_spell_checker
#import ppp_nlp_ml_standalone

class Application:
    def __init__(self):
        self.mapper = Mapper()
        self.mapper.connect('core', '/core/', app=ppp_core.app)
        self.mapper.connect('qp_grammatical', '/qp_grammatical/', app=qp_grammatical.app)
        self.mapper.connect('flower', '/flower/', app=flower.app)
        self.mapper.connect('cas', '/cas/', app=ppp_cas.app)
        self.mapper.connect('spellcheck', '/spell_checker/', app=ppp_spell_checker.app)
        #self.mapper.connect('nlp_ml_standalone', '/nlp_ml_standalone/', app=ppp_nlp_ml_standalone.app)

    def __call__(self, environ, start_response):
        match = self.mapper.routematch(environ=environ)
        app = match[0]['app'] if match else self.not_found
        try:
            return app(environ, start_response)
        except KeyboardInterrupt:
            raise
        except Exception as e:
            traceback.print_exc(e)

    def not_found(self, environ, start_response):
        headers = [('Content-Type', 'text/plain')]
        start_response('404 Not Found', headers)
        return [b'Not found.']

app = Application()
