-
Notifications
You must be signed in to change notification settings - Fork 4
Development: Reuse compliance analysis across languages via snippet mapping
#2470
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
76c5d6e
9adc3e9
7946480
7433eeb
5579180
97f4653
bd80f96
2d02039
23549fd
102ac7b
b0c19fb
8d001be
ee463f7
b7e0862
11e553a
26f3cbd
702dd6c
3aa2f39
dced024
9f21677
630a36f
ba210c9
a035c0d
71a0b76
8820354
d8d704b
48f651c
860c930
ba889b1
ca5d5cc
62be17d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,16 @@ | ||
| package de.tum.cit.aet.ai.dto; | ||
|
|
||
| import com.fasterxml.jackson.annotation.JsonInclude; | ||
| import de.tum.cit.aet.ai.domain.ComplianceIssue; | ||
| import jakarta.validation.constraints.NotBlank; | ||
| import jakarta.validation.constraints.NotNull; | ||
| import java.util.List; | ||
| import java.util.UUID; | ||
|
|
||
| @JsonInclude | ||
| public record MapComplianceIssuesRequestDTO( | ||
| String toLang, | ||
| UUID jobId, | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
| @NotBlank String translatedText, | ||
| @NotNull List<ComplianceIssue> complianceIssues | ||
| ) {} | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,22 @@ | ||
| package de.tum.cit.aet.ai.util; | ||
|
|
||
| /** | ||
| * Validates mapped compliance snippets against the translated target text. | ||
| */ | ||
| public final class SnippetMatcher { | ||
|
|
||
| private SnippetMatcher() {} | ||
|
|
||
| /** | ||
| * Checks whether a non-empty candidate occurs verbatim in the target text. | ||
| * Matching is case-sensitive because the model copies the phrase verbatim and | ||
| * the client searches for that exact phrase in the editor. | ||
| * | ||
| * @param targetText translated job description | ||
| * @param candidate mapped compliance snippet | ||
| * @return {@code true} when the candidate is non-empty and occurs verbatim | ||
| */ | ||
| public static boolean isVerbatim(String targetText, String candidate) { | ||
| return candidate != null && !candidate.isEmpty() && targetText.contains(candidate); | ||
| } | ||
| } |
Uh oh!
There was an error while loading. Please reload this page.