-
-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Skip parsing excluded books when preprocessing
- fixes sillsdev/serval#400
- Loading branch information
Showing
13 changed files
with
350 additions
and
143 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,38 @@ | ||
using System.Collections.Generic; | ||
using System.Collections; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
|
||
namespace SIL.Machine.Corpora | ||
{ | ||
public abstract class AlignmentCorpusBase : CorpusBase<AlignmentRow>, IAlignmentCorpus | ||
public abstract class AlignmentCorpusBase : IAlignmentCorpus | ||
{ | ||
public abstract IEnumerable<IAlignmentCollection> AlignmentCollections { get; } | ||
|
||
public override IEnumerable<AlignmentRow> GetRows() | ||
public virtual int Count(bool includeEmpty = true, IEnumerable<string> textIds = null) | ||
{ | ||
return includeEmpty ? GetRows(textIds).Count() : GetRows(textIds).Count(r => !r.IsEmpty); | ||
} | ||
|
||
int ICorpus<AlignmentRow>.Count(bool includeEmpty) | ||
{ | ||
return Count(includeEmpty, null); | ||
} | ||
|
||
public IEnumerable<AlignmentRow> GetRows() | ||
{ | ||
return GetRows(null); | ||
} | ||
|
||
public abstract IEnumerable<AlignmentRow> GetRows(IEnumerable<string> alignmentCollectionIds); | ||
public abstract IEnumerable<AlignmentRow> GetRows(IEnumerable<string> textIds); | ||
|
||
public IEnumerator<AlignmentRow> GetEnumerator() | ||
{ | ||
return GetRows().GetEnumerator(); | ||
} | ||
|
||
IEnumerator IEnumerable.GetEnumerator() | ||
{ | ||
return GetEnumerator(); | ||
} | ||
} | ||
} |
Oops, something went wrong.