paperless-ngx/src-ui/src/app/data/matching-model.ts

63 lines
1.5 KiB
TypeScript
Raw Normal View History

import { ObjectWithId } from './object-with-id'
2020-10-30 22:46:43 +01:00
2023-02-21 20:01:30 -05:00
export const MATCH_NONE = 0
2020-10-30 22:46:43 +01:00
export const MATCH_ANY = 1
export const MATCH_ALL = 2
export const MATCH_LITERAL = 3
export const MATCH_REGEX = 4
export const MATCH_FUZZY = 5
export const MATCH_AUTO = 6
export const DEFAULT_MATCHING_ALGORITHM = MATCH_AUTO
2020-10-30 22:46:43 +01:00
export const MATCHING_ALGORITHMS = [
2023-02-21 20:01:30 -05:00
{
id: MATCH_AUTO,
shortName: $localize`Automatic`,
name: $localize`Auto: Learn matching automatically`,
2023-02-21 20:01:30 -05:00
},
{
id: MATCH_ANY,
shortName: $localize`Any word`,
name: $localize`Any: Document contains any of these words (space separated)`,
},
{
id: MATCH_ALL,
shortName: $localize`All words`,
name: $localize`All: Document contains all of these words (space separated)`,
},
{
id: MATCH_LITERAL,
shortName: $localize`Exact match`,
name: $localize`Exact: Document contains this string`,
},
{
id: MATCH_REGEX,
shortName: $localize`Regular expression`,
name: $localize`Regular expression: Document matches this regular expression`,
},
{
id: MATCH_FUZZY,
shortName: $localize`Fuzzy word`,
name: $localize`Fuzzy: Document contains a word similar to this word`,
},
{
id: MATCH_NONE,
shortName: $localize`None`,
name: $localize`None: Disable matching`,
},
2020-10-30 22:46:43 +01:00
]
export interface MatchingModel extends ObjectWithId {
name?: string
2020-10-28 18:04:50 +01:00
slug?: string
2020-10-28 18:04:50 +01:00
match?: string
2020-10-28 18:04:50 +01:00
matching_algorithm?: number
2020-10-27 01:10:18 +01:00
is_insensitive?: boolean
document_count?: number
2020-10-27 01:10:18 +01:00
}