Skip to content

escape text#78

Merged
GitVivekHub merged 1 commit into
AgrI-Mitra:mainfrom
YoginiTayade:escapt
Aug 11, 2025
Merged

escape text#78
GitVivekHub merged 1 commit into
AgrI-Mitra:mainfrom
YoginiTayade:escapt

Conversation

@YoginiTayade

@YoginiTayade YoginiTayade commented Aug 11, 2025

Copy link
Copy Markdown
Contributor

Description

Please describe the changes in your pull request in few words here.

Changes

List the changes done to fix a bug or introducing a new feature.

How to test

Describe the steps required to test the changes proposed in the pull request.

Please consider using the closing keyword if the pull request is proposed to
fix an issue already created in the repository
(https://help.github.com/articles/closing-issues-using-keywords/)

Summary by CodeRabbit

  • New Features
    • None
  • Bug Fixes
    • Improved handling of texts with blank lines during translation to prevent errors and ensure smoother processing.
  • Performance
    • Skips empty or whitespace-only lines during per-line translation, reducing unnecessary work and speeding up translations.
    • Lowers external API usage for blank lines without affecting URL placeholder handling or final text reconstruction.
  • Chores
    • No changes to public APIs or exported signatures.

@coderabbitai

coderabbitai Bot commented Aug 11, 2025

Copy link
Copy Markdown

Caution

Review failed

The pull request is closed.

Walkthrough

Added a guard in translate() to skip empty/whitespace lines during per-line translation, avoiding computeBhashini calls for blanks while retaining URL placeholder handling and reconstruction logic. No public API changes.

Changes

Cohort / File(s) Summary of changes
AI Tools Translation Guard
src/modules/aiTools/ai-tools.service.ts
Add per-line empty/whitespace check in translate(); continue loop on blanks to prevent computeBhashini calls; preserve URL placeholder handling and final text reconstruction; no exported/public signature changes.

Sequence Diagram(s)

sequenceDiagram
  participant Caller
  participant AiToolsService as AiToolsService.translate()
  participant Bhashini as computeBhashini

  Caller->>AiToolsService: translate(text)
  AiToolsService->>AiToolsService: Split text into lines
  loop For each line
    alt Line is empty/whitespace
      AiToolsService-->>AiToolsService: Skip processing (continue)
    else Non-empty line
      AiToolsService->>AiToolsService: Handle URL placeholders
      AiToolsService->>Bhashini: translate(line)
      Bhashini-->>AiToolsService: translatedLine
      AiToolsService->>AiToolsService: Restore placeholders
    end
  end
  AiToolsService-->>Caller: Reconstructed translated text
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~7 minutes

Poem

I nudge the lines, hop-skip the blanks,
Save my calls, with tidy ranks.
URLs snug in burrows stay,
While words hop by in bright array.
Less chatter, cleaner trails I tread—
A prudent bunny, light of tread. 🐇✨


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between e6430c0 and 0811ffc.

📒 Files selected for processing (1)
  • src/modules/aiTools/ai-tools.service.ts (1 hunks)
✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai generate unit tests to generate unit tests for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@GitVivekHub GitVivekHub merged commit 9a4f78b into AgrI-Mitra:main Aug 11, 2025
0 of 4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants