diff --git a/src/Microsoft.ML.Data/DataLoadSave/DataReaderExtensions.cs b/src/Microsoft.ML.Data/DataLoadSave/DataReaderExtensions.cs new file mode 100644 index 0000000000..094bb7a29f --- /dev/null +++ b/src/Microsoft.ML.Data/DataLoadSave/DataReaderExtensions.cs @@ -0,0 +1,23 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. + +using Microsoft.Data.DataView; +using Microsoft.ML.Core.Data; +using Microsoft.ML.Data; + +namespace Microsoft.ML +{ + public static class DataReaderExtensions + { + public static IDataView Read(this IDataReader reader, string path) + { + return reader.Read(new MultiFileSource(path)); + } + + public static IDataView Read(this IDataReader reader, params string[] path) + { + return reader.Read(new MultiFileSource(path)); + } + } +} diff --git a/src/Microsoft.ML.Data/DataLoadSave/Text/TextLoader.cs b/src/Microsoft.ML.Data/DataLoadSave/Text/TextLoader.cs index c45c62ed96..fcd652b2e2 100644 --- a/src/Microsoft.ML.Data/DataLoadSave/Text/TextLoader.cs +++ b/src/Microsoft.ML.Data/DataLoadSave/Text/TextLoader.cs @@ -1312,10 +1312,6 @@ public void Save(ModelSaveContext ctx) public IDataView Read(IMultiStreamSource source) => new BoundLoader(this, source); - public IDataView Read(string path) => Read(new MultiFileSource(path)); - - public IDataView Read(params string[] path) => Read(new MultiFileSource(path)); - internal static TextLoader CreateTextReader(IHostEnvironment host, bool hasHeader = DefaultArguments.HasHeader, char separator = DefaultArguments.Separator, diff --git a/src/Microsoft.ML.StaticPipe/LocalPathReader.cs b/src/Microsoft.ML.StaticPipe/LocalPathReader.cs new file mode 100644 index 0000000000..619d933b00 --- /dev/null +++ b/src/Microsoft.ML.StaticPipe/LocalPathReader.cs @@ -0,0 +1,21 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. + +using Microsoft.ML.Data; + +namespace Microsoft.ML.StaticPipe +{ + public static class LocalPathReader + { + public static DataView Read(this DataReader reader, string path) + { + return reader.Read(new MultiFileSource(path)); + } + + public static DataView Read(this DataReader reader, params string[] path) + { + return reader.Read(new MultiFileSource(path)); + } + } +} \ No newline at end of file diff --git a/src/Microsoft.ML.StaticPipe/TextLoaderStatic.cs b/src/Microsoft.ML.StaticPipe/TextLoaderStatic.cs index 0deeb0a4d8..c6cdcf70b4 100644 --- a/src/Microsoft.ML.StaticPipe/TextLoaderStatic.cs +++ b/src/Microsoft.ML.StaticPipe/TextLoaderStatic.cs @@ -4,7 +4,6 @@ using System; using System.Collections.Generic; -using Microsoft.Data.DataView; using Microsoft.ML.Core.Data; using Microsoft.ML.Data; using Microsoft.ML.StaticPipe.Runtime; @@ -306,17 +305,4 @@ public TextLoader.Column Create() } } } - - public static class LocalPathReader - { - public static IDataView Read(this IDataReader reader, params string[] path) - { - return reader.Read(new MultiFileSource(path)); - } - - public static DataView Read(this DataReader reader, params string[] path) - { - return reader.Read(new MultiFileSource(path)); - } - } } \ No newline at end of file