MCPcopy Create free account
hub / github.com/catboost/catboost / TIterableTextFeature

Class TIterableTextFeature

catboost/private/libs/text_processing/dictionary.h:57–86  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

55
56 template <class TTextFeature>
57 class TIterableTextFeature {
58 public:
59 TIterableTextFeature(const TTextFeature& textFeature)
60 : TextFeature(textFeature)
61 {}
62
63 template <class F>
64 void ForEach(F&& visitor) const {
65 for (ui32 i: xrange(Size())) {
66 visitor(i, TextFeature[i]);
67 }
68 }
69
70 template <class F>
71 void ForEach(F&& visitor, NPar::ILocalExecutor* localExecutor) const {
72 NPar::ParallelFor(
73 *localExecutor,
74 0,
75 Size(),
76 [&](ui32 i) { visitor(i, TextFeature[i]); }
77 );
78 }
79
80 ui32 Size() const {
81 return TextFeature.size();
82 }
83
84 private:
85 const TTextFeature& TextFeature;
86 };
87
88 template <>
89 class TIterableTextFeature<ITypedArraySubsetPtr<TString>> {

Callers 4

Y_UNIT_TESTFunction · 0.85
Y_UNIT_TESTFunction · 0.85
CreateTextDataForTestMethod · 0.85
CreateDictionariesFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected