Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 10 additions & 10 deletions lib/bubble_match/sentence/tokenizer.ex
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ defmodule BubbleMatch.Sentence.Tokenizer do
|> post_traverse(:match_and_emit_tag)
)

defp match_and_emit_tag(_rest, inp, context, _, offset) do
defp match_and_emit_tag(rest, inp, context, _, offset) do
{value, raw, type} =
case inp do
[{:word, [text]}] ->
Expand All @@ -71,15 +71,15 @@ defmodule BubbleMatch.Sentence.Tokenizer do
start = offset - String.length(raw)
end_ = start + String.length(String.trim(raw))

{[
%Token{
raw: raw,
start: start,
end: end_,
value: value,
type: type
}
], context}
token = %Token{
raw: raw,
start: start,
end: end_,
value: value,
type: type
}

{rest, [token], context}
end

defparsecp(
Expand Down
8 changes: 4 additions & 4 deletions lib/bubble_match/unidekode.ex
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@ defmodule BubbleMatch.Unidekode do
iex> BubbleMatch.Unidekode.to_ascii("código😀")
"codigo"

iex> BubbleMatch.Unidekode.to_ascii('código')
'codigo'
iex> BubbleMatch.Unidekode.to_ascii(~c'código')
~c'codigo'

iex> BubbleMatch.Unidekode.to_ascii('código℗')
'codigo'
iex> BubbleMatch.Unidekode.to_ascii(~c'código℗')
~c'codigo'
"""
@spec to_ascii(binary() | charlist()) :: binary() | charlist()
def to_ascii(string), do: to_ascii(string, <<>>)
Expand Down
Loading