|
42 | 42 | Detector.find_or_create_by(name: 'SuggestedResource') |
43 | 43 | Detector.find_or_create_by(name: 'Citation') |
44 | 44 | Detector.find_or_create_by(name: 'Barcode') |
| 45 | +Detector.find_or_create_by(name: 'SuggestedResourcePattern') |
45 | 46 |
|
46 | 47 | # DetectorCategories |
47 | 48 | DetectorCategory.find_or_create_by( |
|
84 | 85 | category: Category.find_by(name: 'Transactional'), |
85 | 86 | confidence: 0.2 |
86 | 87 | ) |
| 88 | +DetectorCategory.find_or_create_by( |
| 89 | + detector: Detector.find_by(name: 'SuggestedResourcePattern'), |
| 90 | + category: Category.find_by(name: 'Transactional'), |
| 91 | + confidence: 0.9 |
| 92 | +) |
| 93 | + |
| 94 | +# Patterns for Suggested Resources |
| 95 | +SuggestedPattern.find_or_create_by( |
| 96 | + title: 'Looking for Standards?', |
| 97 | + url: 'https://libguides.mit.edu/standards', |
| 98 | + pattern: '(IEC|iec)(\\s)(\\d{5})', |
| 99 | + shortcode: 'iec' |
| 100 | +) |
| 101 | +SuggestedPattern.find_or_create_by( |
| 102 | + title: 'Looking for Standards?', |
| 103 | + url: 'https://libguides.mit.edu/standards', |
| 104 | + pattern: '(ASCE|asce)(\\s)(\\d)', |
| 105 | + shortcode: 'asce' |
| 106 | +) |
| 107 | +SuggestedPattern.find_or_create_by( |
| 108 | + title: 'Looking for Standards?', |
| 109 | + url: 'https://libguides.mit.edu/standards', |
| 110 | + pattern: '(IEEE|ieee)\\s+(?:Std\\s+)?([PC]?[0-9]{3,4})', |
| 111 | + shortcode: 'ieee' |
| 112 | +) |
| 113 | +SuggestedPattern.find_or_create_by( |
| 114 | + title: 'Looking for Standards?', |
| 115 | + url: 'https://libguides.mit.edu/standards', |
| 116 | + pattern: '(ISO|iso)\\s(\\d{1,5})', |
| 117 | + shortcode: 'iso' |
| 118 | +) |
| 119 | +SuggestedPattern.find_or_create_by( |
| 120 | + title: 'Looking for Standards?', |
| 121 | + url: 'https://libguides.mit.edu/standards', |
| 122 | + pattern: '(ASTM|astm)\\s', |
| 123 | + shortcode: 'astm' |
| 124 | +) |
87 | 125 |
|
88 | 126 | Rails.logger.info('Seeding DB complete') |
0 commit comments