PageRenderTime 25ms queryTime 123ms sortTime 1ms getByIdsTime 1307ms findMatchingLines 33ms

9+ results for 'spelling corrector lang:java' (25 ms)

Not the results you expected?
PopulateSpellingCorrectorJob.java https://github.com/boyter/searchcode-server.git | Java | 81 lines
                    
20@DisallowConcurrentExecution
                    
21public class PopulateSpellingCorrectorJob implements Job {
                    
22
                    
25
                    
26    public PopulateSpellingCorrectorJob() {
                    
27        this.logger = Singleton.getLogger();
                    
32        Path path = Paths.get(Properties.getProperties().getProperty(Values.REPOSITORYLOCATION, Values.DEFAULTREPOSITORYLOCATION));
                    
33        this.logger.info(String.format("4f5b6cb6::starting populatespellingcorrector in path %s", path.toString()));
                    
34
                    
67
                    
68                        Singleton.getSearchCodeLib().addToSpellingCorrector(String.join(" ", codeLines));
                    
69                    } catch (Exception ex) {
                    
                
SpellingCorrectorTest.java https://github.com/kbaribeau/Spelling-Corrector.git | Java | 57 lines
                    
7public class SpellingCorrectorTest {
                    
8	SpellingCorrector spellingCorrector = new SpellingCorrector();
                    
9
                    
16	
                    
17		assertEquals(words, spellingCorrector.applySingleCharacterDeletions("the"));
                    
18	}
                    
26
                    
27		assertEquals(words, spellingCorrector.applyTranspositions("test"));
                    
28	}
                    
31	public void shouldReturnAlterations() throws Exception {
                    
32		assertEquals(101, spellingCorrector.applyOneLetterTypeos("test").size());
                    
33	}
                    
42	public void shouldReturnTheCorrectWord() throws Exception {
                    
43		assertEquals("access", spellingCorrector.correct("acess"));
                    
44		assertEquals("access", spellingCorrector.correct("access"));
                    
                
SpellingCorrectorTest.java https://github.com/boyter/searchcode-server.git | Java | 123 lines
                    
14    public void testEmptyNullTerms() {
                    
15        ISpellingCorrector sc = this.getSpellingCorrector();
                    
16        assertNull(sc.correct(null));
                    
21    public void testSingleLetter() {
                    
22        ISpellingCorrector sc = getSpellingCorrector();
                    
23        sc.correct("a");
                    
65    public void testSpellingCorrectorExtraLetter() {
                    
66        ISpellingCorrector sc = this.getSpellingCorrector();
                    
67        sc.putWord("default");
                    
105    public void testLongStringPerformance() {
                    
106        ISpellingCorrector sc = this.getSpellingCorrector();
                    
107        sc.correct("thisisareallylongstringthatshouldcalusethingstorunreallyslow");
                    
111        Random rand = new Random();
                    
112        ISpellingCorrector sc = getSpellingCorrector();
                    
113
                    
                
Main.java https://gitlab.com/mountain01/spelling-corrector.git | Java | 50 lines
                    
4
                    
5import spell.SpellCorrector.NoSimilarWordFoundException;
                    
6
                    
7/**
                    
8 * A simple main class for running the spelling corrector
                    
9 */
                    
21		/**
                    
22		 * Create an instance of your corrector here
                    
23		 */
                    
23		 */
                    
24		SpellCorrector corrector = new SpellingCorrector();
                    
25        Trie trie1 = new Words();
                    
42
                    
43		corrector.useDictionary(dictionaryFileName);
                    
44
                    
                
Values.java https://github.com/boyter/searchcode-server.git | Java | 233 lines
                    
44    public static final String DEFAULTINDEXTIME = "5";
                    
45    public static final String SPELLINGCORRECTORSIZE = "spelling_corrector_size";
                    
46    public static final String DEFAULTSPELLINGCORRECTORSIZE = "10000";
                    
                
1.java https://github.com/boyter/scc.git | Java | 186 lines
                    
1package com.boyter.SpellingCorrector;
                    
2
                    
10 */
                    
11public class SpellingCorrector implements ISpellingCorrector {
                    
12
                    
15
                    
16    public SpellingCorrector(int lruCount) {
                    
17        this.dictionary = Collections.synchronizedMap(new LruCache<>(lruCount));
                    
121    /**
                    
122     * Return a list of strings which are words similar to our one which could potentially be misspellings
                    
123     * Abuse the fact that a char can be used as an integer
                    
                
SearchcodeSpellingCorrector.java https://github.com/boyter/searchcode-server.git | Java | 213 lines
                    
24 */
                    
25public class SearchcodeSpellingCorrector implements ISpellingCorrector {
                    
26
                    
27    // How many terms to keep in the LRUCACHE
                    
28    private int LRUCOUNT = Integer.parseInt(Values.DEFAULTSPELLINGCORRECTORSIZE);
                    
29
                    
35    public SearchcodeSpellingCorrector() {
                    
36        this.LRUCOUNT = Integer.parseInt(Properties.getProperties().getProperty(Values.SPELLINGCORRECTORSIZE, Values.DEFAULTSPELLINGCORRECTORSIZE));
                    
37        if (this.LRUCOUNT <= 0) {
                    
37        if (this.LRUCOUNT <= 0) {
                    
38            this.LRUCOUNT = Integer.parseInt(Values.DEFAULTSPELLINGCORRECTORSIZE);
                    
39        }
                    
172    /**
                    
173     * Return a list of strings which are words similar to our one which could potentially be misspellings
                    
174     * Abuse the fact that a char can be used as an integer
                    
                
SearchCodeLib.java https://github.com/boyter/searchcode-server.git | Java | 595 lines
                    
26
                    
27    private final ISpellingCorrector spellingCorrector;
                    
28    private final FileClassifier fileClassifier;
                    
39    public SearchCodeLib() {
                    
40        this(Singleton.getSpellingCorrector(), new FileClassifier(), Singleton.getData(), Singleton.getHelpers());
                    
41    }
                    
42
                    
43    public SearchCodeLib(ISpellingCorrector spellingCorrector, FileClassifier fileClassifier, Data data, Helpers helpers) {
                    
44        this.spellingCorrector = spellingCorrector;
                    
168    /**
                    
169     * Adds a string into the spelling corrector.
                    
170     * TODO move this into the spelling corrector class itself
                    
171     */
                    
172    public void addToSpellingCorrector(String contents) {
                    
173        if (contents == null) {
                    
                
AdminRouteService.java https://github.com/boyter/searchcode-server.git | Java | 577 lines
                    
125        map.put(Values.LOWMEMORY, Properties.getProperties().getProperty(Values.LOWMEMORY, Values.DEFAULTLOWMEMORY));
                    
126        map.put(Values.SPELLINGCORRECTORSIZE, Properties.getProperties().getProperty(Values.SPELLINGCORRECTORSIZE, Values.DEFAULTSPELLINGCORRECTORSIZE));
                    
127        map.put(Values.USESYSTEMGIT, Properties.getProperties().getProperty(Values.USESYSTEMGIT, Values.DEFAULTUSESYSTEMGIT));
                    
159        map.put("currentdatetime", this.getStat("servertime"));
                    
160        map.put("spellingCount", this.getStat("spellingCount"));
                    
161        map.put("runningJobs", this.getStat("runningJobs"));
                    
                
 

Source

Language