Class: AnalysisController
- Inherits:
-
ApplicationController
- Object
- ActionController::API
- ApplicationController
- AnalysisController
- Defined in:
- app/controllers/analysis_controller.rb
Overview
形態素解析リクエストを処理します。
Instance Method Summary collapse
-
#parse ⇒ void
指定されたテキストを MeCab を使用して解析します。.
Instance Method Details
#parse ⇒ void
This method returns an undefined value.
指定されたテキストを MeCab を使用して解析します。
9 10 11 12 13 14 15 16 17 18 |
# File 'app/controllers/analysis_controller.rb', line 9 def parse text = params[:text] result = MecabParser.execute(text) if result.success? render json: { payload: result.payload }, status: :ok else render json: { message: result.error }, status: :internal_server_error end end |