docs: preserve intent in language and query guidance

This commit is contained in:
haelyra
2026-09-30 18:02:22 -04:00
parent 85b4e4eea3
commit 5af55fad0a
4 changed files with 28 additions and 16 deletions
+6 -2
View File
@@ -186,13 +186,17 @@ BANGLA_STOP_WORDS = {
"এবং", "ও", "এ", "এই", "সেই", "তার", "যে", "একটি",
"করে", "হয়", "আর", "কিন্তু", "তবে", "যদি", "তাহলে",
"আমি", "তুমি", "সে", "আমরা", "তোমরা", "তারা",
"হবে", "ছিল", "আছে", "নেই", "থেকে", "জন্য", "সাথে",
"হবে", "ছিল", "আছে", "থেকে", "জন্য", "সাথে",
"পর", "আগে", "উপর", "নিচে", "মধ্যে", "দিয়ে",
"কি", "কে", "কোন", "কোথায়", "কেন", "কিভাবে",
"না", "নয়", "হ্যাঁ", "অনেক", "কিছু", "সব", "প্রতি",
"হ্যাঁ", "অনেক", "কিছু", "সব", "প্রতি",
}
```
Keep negators such as `না`, `নয়`, and `নেই` out of a generic stop-word list.
They change intent and sentiment, so remove them only for a task that explicitly
models negation elsewhere.
### Sorting and Collation
Bengali has a defined sort order (স্বরবর্ণ before ব্যঞ্জনবর্ণ). Use locale-aware sorting:
+8 -6
View File
@@ -200,15 +200,17 @@ public List<UserSummary> search(UserSearchRequest request) {
}
```
The mapper retains the `ids.size() > 0` guard as defense in depth, but callers
must not rely on an empty `<foreach>` to define query semantics. The service
boundary must ensure this query is reached only with a non-empty list or a
deliberate `null` meaning "no ID filter".
The mapper retains the `ids.size() > 0` guard as defense in depth. That guard
omits the entire ID predicate for an empty list, which broadens the query. The
service must short-circuit empty lists before calling the mapper, and any caller
that bypasses the service must reject empty IDs before query execution. Reserve
`null` for the deliberate "no ID filter" case.
- Prefer `<where>`, `<set>`, `<trim>`, `<choose>`, and `<foreach>` to manual
string concatenation.
- Define the empty-list behavior in the service. Return no rows, skip the
query, or apply an explicit false predicate; never rely on `IN ()` behavior.
- Define the empty-list behavior in the service. Return no rows, skip the query,
or apply an explicit false predicate; never let an empty list silently remove
the ID predicate or rely on `IN ()` behavior.
- Keep the allowed shape of dynamic SQL small. If a query has many branches,
split it into named statements or move carefully selected alternatives into
separate mapper methods.
+6 -2
View File
@@ -186,13 +186,17 @@ BANGLA_STOP_WORDS = {
"এবং", "ও", "এ", "এই", "সেই", "তার", "যে", "একটি",
"করে", "হয়", "আর", "কিন্তু", "তবে", "যদি", "তাহলে",
"আমি", "তুমি", "সে", "আমরা", "তোমরা", "তারা",
"হবে", "ছিল", "আছে", "নেই", "থেকে", "জন্য", "সাথে",
"হবে", "ছিল", "আছে", "থেকে", "জন্য", "সাথে",
"পর", "আগে", "উপর", "নিচে", "মধ্যে", "দিয়ে",
"কি", "কে", "কোন", "কোথায়", "কেন", "কিভাবে",
"না", "নয়", "হ্যাঁ", "অনেক", "কিছু", "সব", "প্রতি",
"হ্যাঁ", "অনেক", "কিছু", "সব", "প্রতি",
}
```
Keep negators such as `না`, `নয়`, and `নেই` out of a generic stop-word list.
They change intent and sentiment, so remove them only for a task that explicitly
models negation elsewhere.
### Sorting and Collation
Bengali has a defined sort order (স্বরবর্ণ before ব্যঞ্জনবর্ণ). Use locale-aware sorting:
+8 -6
View File
@@ -200,15 +200,17 @@ public List<UserSummary> search(UserSearchRequest request) {
}
```
The mapper retains the `ids.size() > 0` guard as defense in depth, but callers
must not rely on an empty `<foreach>` to define query semantics. The service
boundary must ensure this query is reached only with a non-empty list or a
deliberate `null` meaning "no ID filter".
The mapper retains the `ids.size() > 0` guard as defense in depth. That guard
omits the entire ID predicate for an empty list, which broadens the query. The
service must short-circuit empty lists before calling the mapper, and any caller
that bypasses the service must reject empty IDs before query execution. Reserve
`null` for the deliberate "no ID filter" case.
- Prefer `<where>`, `<set>`, `<trim>`, `<choose>`, and `<foreach>` to manual
string concatenation.
- Define the empty-list behavior in the service. Return no rows, skip the
query, or apply an explicit false predicate; never rely on `IN ()` behavior.
- Define the empty-list behavior in the service. Return no rows, skip the query,
or apply an explicit false predicate; never let an empty list silently remove
the ID predicate or rely on `IN ()` behavior.
- Keep the allowed shape of dynamic SQL small. If a query has many branches,
split it into named statements or move carefully selected alternatives into
separate mapper methods.