public RowCursor(NltTokenizeTransform parent, IRowCursor input, bool[] active) : base(parent.Host, input) { Ch.AssertValue(parent._bindings); Ch.AssertNonEmpty(parent._bindings.Infos); Ch.AssertNonEmpty(parent._bindings.GroupInfos); Ch.Assert(active == null || active.Length == parent._bindings.ColumnCount); _bindings = parent._bindings; _active = active; var resourcesExist = new bool?[Tokenizers.Length]; var infos = parent._bindings.Infos; _getters = new ValueGetter<VBuffer<DvText>>[infos.Length]; var groupCurHelpers = new GroupCursorHelper[_bindings.SrcColsCount]; for (int iinfo = 0; iinfo < infos.Length; iinfo++) { if (_active != null && !_active[_bindings.MapIinfoToCol(iinfo)]) continue; int groupId = infos[iinfo].GroupInfoId; if (groupCurHelpers[groupId] == null) groupCurHelpers[groupId] = new GroupCursorHelper(input, _bindings.GroupInfos[groupId], resourcesExist); var groupState = groupCurHelpers[groupId]; if (infos[iinfo].IsTypes) _getters[iinfo] = groupState.GetTypes; else _getters[iinfo] = groupState.GetTokens; } }
private NltTokenizeTransform(IHostEnvironment env, NltTokenizeTransform xf, IDataView newSource) : base(env, RegistrationName, newSource) { _bindings = Bindings.Create(xf._bindings, newSource.Schema); }