Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions apps/common/util/split_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -344,9 +344,9 @@ def parse(self, text: str):
'content' in item and len(item.get('content').strip()) > 0]

def post_reset_paragraph(self, paragraph: Dict, title_list: List[str]):
result = self.filter_title_special_characters(paragraph)
result = self.content_is_null(paragraph, title_list)
result = self.filter_title_special_characters(result)
result = self.sub_title(result)
result = self.content_is_null(result, title_list)
return result

@staticmethod
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The provided code snippet is incomplete and lacks the necessary content to properly analyze it. It seems like there's an ongoing process of refactoring or commenting out certain sections of the code, where self.filter_title_special_characters, self.content_is_null, and other methods or attributes are referenced but not defined.

To assist effectively:

  1. Complete Definition: Ensure all required functions (e.g., filter_title_special_characters, sub_title) and their dependencies are added to your class.

  2. Ensure Correct Method Signatures: Verify that all method signatures (post_reset_paragraph) match those expected by your class definition.

  3. Add Context: Provide more context about how these methods interact with each other since you've mentioned they're used together in post_reset_paragraph.

Here’s what I mean by some general improvements:

def parse(self, text: str) -> List[Dict]:
    # Your implementation here

@staticmethod
def filter_title_special_characters(text: Dict) -> Dict:
    # Remove special characters from titles
    return {
        'title': ''.join(char for char in text['title'] if char.isalnum() or char == '-'),
        'content': ''.join(
            char.lower() if char.isalpha() else (
                '' if len(str(int(char))) != 1	else char.upper()
            ) for char in text['content']
        )
    }

@staticmethod
def sub_title(text: Dict) -> Dict:
    # Implement subtitle removal/logic as needed
    pass

If you have specific requirements, additional logic can be implemented accordingly.

Expand Down