Skip to content

Commit 281936e

Browse files
committed
fix(stemming): use double quotes for newline characters
- replace single-quoted `\n` with double-quoted `"\n"` in `jsonl` string processing - fix inconsistent line splitting behavior in `upsert` method
1 parent e65dc42 commit 281936e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/typesense/stemming_dictionaries.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ def initialize(api_call)
1111

1212
def upsert(dict_id, words_and_roots_combinations)
1313
words_and_roots_combinations_in_jsonl = if words_and_roots_combinations.is_a?(Array)
14-
words_and_roots_combinations.map { |combo| Oj.dump(combo, mode: :compat) }.join('\n')
14+
words_and_roots_combinations.map { |combo| Oj.dump(combo, mode: :compat) }.join("\n")
1515
else
1616
words_and_roots_combinations
1717
end
@@ -25,7 +25,7 @@ def upsert(dict_id, words_and_roots_combinations)
2525
)
2626

2727
if words_and_roots_combinations.is_a?(Array)
28-
result_in_jsonl.split('\n').map { |r| Oj.load(r) }
28+
result_in_jsonl.split("\n").map { |r| Oj.load(r) }
2929
else
3030
result_in_jsonl
3131
end

0 commit comments

Comments
 (0)