Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
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
4 changes: 2 additions & 2 deletions src/Microsoft.ML.Core/Utilities/NormStr.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ internal sealed class NormStr
private NormStr(ReadOnlyMemory<char> str, int id, uint hash)
{
Contracts.Assert(id >= 0 || id == -1 && str.IsEmpty);
Value = str;
Value = new ReadOnlyMemory<char>(str.ToString().ToCharArray());
Comment thread
antoniovs1029 marked this conversation as resolved.
Outdated
Id = id;
_hash = hash;
}
Expand Down Expand Up @@ -136,7 +136,7 @@ public NormStr Get(ReadOnlyMemory<char> str, bool add = false)
}
Contracts.Assert(ins == -1);

return add ? AddCore(str, hash) : null;
return add ? AddCore(str.ToString().AsMemory(), hash) : null;
Comment thread
antoniovs1029 marked this conversation as resolved.
Outdated
}

/// <summary>
Expand Down
3 changes: 2 additions & 1 deletion src/Microsoft.ML.Transforms/Text/TextNormalizing.cs
Original file line number Diff line number Diff line change
Expand Up @@ -398,7 +398,8 @@ private void NormalizeSrc(in ReadOnlyMemory<char> src, ref ReadOnlyMemory<char>
if (min == 0)
{
Host.Assert(src.Length == len);
dst = src;
buffer.AppendSpan(span);
dst = buffer.ToString().AsMemory();
}
Comment thread
antoniovs1029 marked this conversation as resolved.
else
{
Expand Down