-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
…proceeds.
- Loading branch information
Showing
16 changed files
with
46 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
from arekit.common.pipeline.context import PipelineContext | ||
from arekit.common.pipeline.item import TextParserPipelineItem | ||
|
||
|
||
class BasePipeline(object): | ||
|
||
def __init__(self, pipeline): | ||
assert(isinstance(pipeline, list)) | ||
self.__pipeline = pipeline | ||
|
||
def run(self, pipeline_ctx): | ||
assert(isinstance(pipeline_ctx, PipelineContext)) | ||
|
||
for item in filter(lambda itm: itm is not None, self.__pipeline): | ||
assert(isinstance(item, TextParserPipelineItem)) | ||
item.apply(pipeline_ctx) |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
from arekit.common.pipeline.context import PipelineContext | ||
|
||
|
||
class TextParserPipelineItem(object): | ||
""" Single pipeline item that might be instatiated and embedded into pipeline. | ||
""" | ||
|
||
def apply(self, pipeline_ctx): | ||
assert(isinstance(pipeline_ctx, PipelineContext)) | ||
raise NotImplementedError() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,9 @@ | ||
from arekit.common.pipeline.base import BasePipeline | ||
from arekit.common.text.parsed import BaseParsedText | ||
from arekit.common.text.pipeline_ctx import PipelineContext | ||
from arekit.common.text.pipeline_item import TextParserPipelineItem | ||
|
||
|
||
class BaseTextParser(object): | ||
|
||
def __init__(self, pipeline): | ||
assert(isinstance(pipeline, list)) | ||
self.__pipeline = pipeline | ||
|
||
def parse(self, pipeline_ctx): | ||
assert(isinstance(pipeline_ctx, PipelineContext)) | ||
|
||
for item in filter(lambda itm: itm is not None, self.__pipeline): | ||
assert(isinstance(item, TextParserPipelineItem)) | ||
item.apply(pipeline_ctx) | ||
class BaseTextParser(BasePipeline): | ||
|
||
def run(self, pipeline_ctx): | ||
super(BaseTextParser, self).run(pipeline_ctx) | ||
return BaseParsedText(terms=pipeline_ctx.provide("src")) |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters