File tree Expand file tree Collapse file tree 2 files changed +8
-8
lines changed
Expand file tree Collapse file tree 2 files changed +8
-8
lines changed Original file line number Diff line number Diff line change @@ -434,13 +434,13 @@ describe('BlockService', () => {
434434 describe ( 'calculateBlockScore' , ( ) => {
435435 const nlpPenaltyFactor = 0.9 ;
436436 it ( 'should calculate the correct NLP score for a block' , async ( ) => {
437- const score = await blockService . calculateBlockScore (
437+ const score = blockService . calculateBlockScore (
438438 mockNlpPatternsSetOne ,
439439 mockNlpEntitiesSetOne ,
440440 mockNlpCacheMap ,
441441 nlpPenaltyFactor ,
442442 ) ;
443- const score2 = await blockService . calculateBlockScore (
443+ const score2 = blockService . calculateBlockScore (
444444 mockNlpPatternsSetTwo ,
445445 mockNlpEntitiesSetOne ,
446446 mockNlpCacheMap ,
@@ -453,13 +453,13 @@ describe('BlockService', () => {
453453 } ) ;
454454
455455 it ( 'should calculate the correct NLP score for a block and apply penalties ' , async ( ) => {
456- const score = await blockService . calculateBlockScore (
456+ const score = blockService . calculateBlockScore (
457457 mockNlpPatternsSetOne ,
458458 mockNlpEntitiesSetOne ,
459459 mockNlpCacheMap ,
460460 nlpPenaltyFactor ,
461461 ) ;
462- const score2 = await blockService . calculateBlockScore (
462+ const score2 = blockService . calculateBlockScore (
463463 mockNlpPatternsSetThree ,
464464 mockNlpEntitiesSetOne ,
465465 mockNlpCacheMap ,
@@ -473,7 +473,7 @@ describe('BlockService', () => {
473473
474474 it ( 'should return 0 if no matching entities are found' , async ( ) => {
475475 const nlpCacheMap : NlpCacheMap = new Map ( ) ;
476- const score = await blockService . calculateBlockScore (
476+ const score = blockService . calculateBlockScore (
477477 mockNlpPatternsSetTwo ,
478478 mockNlpEntitiesSetOne ,
479479 nlpCacheMap ,
Original file line number Diff line number Diff line change @@ -412,7 +412,7 @@ export class BlockService extends BaseService<
412412 const block = blocks [ i ] ;
413413 const patterns = matchedPatterns [ i ] ;
414414 // If compatible, calculate the NLP score for this block
415- const nlpScore : number = await this . calculateBlockScore (
415+ const nlpScore : number = this . calculateBlockScore (
416416 patterns ,
417417 nlp ,
418418 nlpCacheMap ,
@@ -445,12 +445,12 @@ export class BlockService extends BaseService<
445445 * @param nlpPenaltyFactor - A multiplier applied to scores when the pattern match type is 'entity'.
446446 * @returns A numeric score representing how well the block matches the given NLP context.
447447 */
448- async calculateBlockScore (
448+ calculateBlockScore (
449449 patterns : NlpPattern [ ] ,
450450 nlp : NLU . ParseEntities ,
451451 nlpCacheMap : NlpCacheMap ,
452452 nlpPenaltyFactor : number ,
453- ) : Promise < number > {
453+ ) : number {
454454 // Compute individual pattern scores using the cache
455455 const patternScores : number [ ] = patterns . map ( ( pattern ) => {
456456 const entityData = nlpCacheMap . get ( pattern . entity ) ;
You can’t perform that action at this time.
0 commit comments