Example #1
0
        /// <summary>
        /// Standardowy konstruktor
        /// </summary>
        /// <param name="workingDirPath">Ścieżka do katalogu z danymi HAL</param>
        /// <param name="fwdIndex">Indeks wprzód (używany w trybie IxHalCalculationMode.CALCULATE_HAL_ON_DEMAND, inaczej
        /// może być null)</param>
        /// <param name="invIndex">Odwrócony indeks (używany w trybie IxHalCalculationMode.CALCULATE_HAL_ON_DEMAND, inaczej
        /// może być null)</param>
        public IxHalContextObtainer(string workingDirPath, IxStdDiskFwdIndex fwdIndex, IxStdDiskRIIndex invIndex)
        {
            switch (IxSettings.halSearchMode)
            {
                case IxHalCalculationMode.CALCULATE_HAL_ON_DEMAND:
                    halContextOnDemandComputer = new IxHalOnDemCtxComp(workingDirPath, invIndex, fwdIndex);

                    break;

                case IxHalCalculationMode.CALCULATE_CONTEXT_ON_PREPARED_HAL:
                    halContextComputer = new IxHalCtxComp(workingDirPath);

                    break;

                case IxHalCalculationMode.USE_PRECALCULATED_CONTEXT:
                    halContext = new IxHalContext(workingDirPath, IxHalContext.Mode.READ);

                    break;

                default:
                    throw new NotImplementedException();

                    break;
            }
        }
Example #2
0
        /// <summary>
        /// Standardowy konstruktor
        /// </summary>
        /// <param name="workingDir">Katalog z danymi indeksu</param>
        public IxStdRISearchEngine(string workingDir)
        {
            workingDir = Misc.provideEndBackslash(workingDir);

            invIndex = new IxStdDiskRIIndex(workingDir + "invIndex", IxIndexMode.READ);
            documentsIndex = new IxStdDiskDocumentsIndex(workingDir + "documents", DocumentsIndexMode.READ);
            fwdDict = new IxFwdDistDiskDict(workingDir + "fwdDict", IxDictionaryMode.READ, null);
            tokenListing = new IxTokenizer(fwdDict);

            documentsCount = (double)invIndex.getDocumentsCount();
        }
Example #3
0
        /// <summary>
        /// Standardowy konstruktor
        /// </summary>
        /// <param name="workingDir">Katalog z danymi indeksu</param>
        public IxHALIRSearchEngine(string workingDir)
        {
            workingDir = Misc.provideEndBackslash(workingDir);
            this.workingDir = workingDir;

            invIndex = new IxStdDiskRIIndex(workingDir + "invIndex", IxIndexMode.READ);
            fwdIndex = new IxStdDiskFwdIndex(workingDir + "fwdIndex", IxIndexMode.READ);
            documentsIndex = new IxStdDiskDocumentsIndex(workingDir + "documents", DocumentsIndexMode.READ);
            fwdDictionary = new IxFwdDistDiskDict(workingDir + "fwdDict", IxDictionaryMode.READ, null);
            bkdDictionary = new IxStdBkdDiskDict(workingDir + "bkdDict", IxDictionaryMode.READ);
            tokenListing = new IxTokenizer(fwdDictionary);
            halContextObtainer = new IxHalContextObtainer(workingDir + "hal", fwdIndex, invIndex);

            documentsCount = (double)invIndex.getDocumentsCount();
        }