Strip «آماده به کار» from role names + reject domestic-helper ads
Re-check of live applicants found two gaps: - «کمک بهیار آماده به کار» — the availability phrase glued onto the role. StripRoleModifiers now removes «آماده به کار / آماده همکاری / جویای کار / جهت همکاری» phrases before token-stripping, so the role collapses to «کمک بهیار». - «خانم امورسبک منزل» — light-housework domestic helpers (not کادر درمان). Validator now discards ads with «امور منزل / نظافت منزل / خدمتکار / مستخدم …» markers. Both take effect for existing data on the next applicant reprocess. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -610,11 +610,18 @@ public class IngestionService
|
||||
private static readonly string[] RoleModifierWords =
|
||||
{ "آقا", "خانم", "خانوم", "بانو", "مرد", "زن", "کارآموز", "کارورز", "ارشد", "مبتدی" };
|
||||
|
||||
/// <summary>Remove modifier tokens from a role name, keeping the base profession. Never strips to
|
||||
/// empty (falls back to the original).</summary>
|
||||
// Availability phrases that the model sometimes glues onto the role («کمک بهیار آماده به کار»);
|
||||
// removed as whole substrings before token-stripping (so «به»/«کار» tokens stay safe elsewhere).
|
||||
private static readonly string[] RolePhraseNoise =
|
||||
{ "آماده به کار", "آماده همکاری", "آماده بکار", "آماده به همکاری", "جویای کار", "دنبال کار", "جهت همکاری" };
|
||||
|
||||
/// <summary>Remove availability phrases + gender/seniority tokens from a role name, keeping the
|
||||
/// base profession. Never strips to empty (falls back to the original).</summary>
|
||||
private static string StripRoleModifiers(string name)
|
||||
{
|
||||
var kept = NormalizeFa(name).Split(' ', StringSplitOptions.RemoveEmptyEntries)
|
||||
var n = NormalizeFa(name);
|
||||
foreach (var p in RolePhraseNoise) n = n.Replace(NormalizeFa(p), " ");
|
||||
var kept = n.Split(' ', StringSplitOptions.RemoveEmptyEntries)
|
||||
.Where(t => !RoleModifierWords.Any(m => NormalizeFa(m) == t)).ToList();
|
||||
return kept.Count > 0 ? string.Join(" ", kept) : name.Trim();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user