Created
          May 22, 2020 15:29 
        
      - 
      
- 
        Save bytemain/22409d1065c2e3f3359c34fe6aeb4945 to your computer and use it in GitHub Desktop. 
    rapid_fuzz test
  
        
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | from rapidfuzz import fuzz, process | |
| print( | |
| "QRatio", | |
| process.extractOne("lengthmin", ["cs", "man", "help", "bind"], fuzz.QRatio), | |
| ) | |
| print( | |
| "WRatio", | |
| process.extractOne("lengthmin", ["cs", "man", "help", "bind"], fuzz.WRatio), | |
| ) | |
| print( | |
| "partial_ratio", | |
| process.extractOne("lengthmin", ["cs", "man", "help", "bind"], fuzz.partial_ratio), | |
| ) | |
| print( | |
| "ratio", process.extractOne("lengthmin", ["cs", "man", "help", "bind"], fuzz.ratio), | |
| ) | |
| print( | |
| "token_ratio", | |
| process.extractOne("lengthmin", ["cs", "man", "help", "bind"], fuzz.token_ratio), | |
| ) | |
| print( | |
| "quick_lev_ratio", | |
| process.extractOne( | |
| "lengthmin", ["cs", "man", "help", "bind"], fuzz.quick_lev_ratio | |
| ), | |
| ) | |
| print( | |
| "QRatio", | |
| process.extractOne("提醒", ["我的提醒", "cs", "man", "help", "bind"], fuzz.QRatio), | |
| ) | |
| print( | |
| "WRatio", | |
| process.extractOne("提醒", ["我的提醒", "cs", "man", "help", "bind"], fuzz.WRatio), | |
| ) | |
| print( | |
| "partial_ratio", | |
| process.extractOne("提醒", ["我的提醒", "cs", "man", "help", "bind"], fuzz.partial_ratio), | |
| ) | |
| print( | |
| "ratio", | |
| process.extractOne("提醒", ["我的提醒", "cs", "man", "help", "bind"], fuzz.ratio), | |
| ) | |
| print( | |
| "token_ratio", | |
| process.extractOne("提醒", ["我的提醒", "cs", "man", "help", "bind"], fuzz.token_ratio), | |
| ) | |
| print( | |
| "token_sort_ratio", | |
| process.extractOne( | |
| "提醒", ["我的提醒", "cs", "man", "help", "bind"], fuzz.token_sort_ratio | |
| ), | |
| ) | |
| print( | |
| "quick_lev_ratio", | |
| process.extractOne( | |
| "提醒", ["我的提醒", "cs", "man", "help", "bind"], fuzz.quick_lev_ratio | |
| ), | |
| ) | 
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment