simstring | Python implementation of the SimString , a simple | Natural Language Processing library
kandi X-RAY | simstring Summary
kandi X-RAY | simstring Summary
A Python implementation of the SimString, a simple and efficient algorithm for approximate string matching.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
- Helper function to output similar strings
- Perform overlap search
- Search the given query string
- Add a string to the list
- Perform a ranked search
- Internal helper to lookup strings by feature size and feature size
- Minimum overlap between two features
- Extract features from text
- Return a list of n - gram
- Generate a list of n - grams
- Extracts the features from the given text
- Parses text into tokens
- The surface of the token
- Return a list of all documents
- Return all documents in the collection
- Return features in a string
simstring Key Features
simstring Examples and Code Snippets
Community Discussions
Trending Discussions on simstring
QUESTION
I'm trying to install the C++ package simstring on a python docker image (python:latest or python:3.7)
Steps I take are, following the instructions from the repo / from what I've been able to gather:
...ANSWER
Answered 2019-Nov-13 at 11:27you can use this Dockerfile:
QUESTION
I am trying to install simstring python wrapper in windows by https://github.com/Georgetown-IR-Lab/simstring. For linux it works fine but for windows it is giving me error while installing.
...ANSWER
Answered 2018-Dec-20 at 12:14Ground notes:
I managed to go with the build process but I got stuck at one point. I created [SO]: Compile error for (char based) STL (stream) containers in Visual Studio (I spent quite some time on that issue). I got that working somehow, but there were other (similar?) errors when trying to build simstring, so I had to strip some (Nix based) code (that didn't compile) out
simstring is written in C++. When C++ (C) code is built, the result is PE or Portable Executable (.exe, .dll). Check [SO]: LNK2005 Error in CLR Windows Form (@CristiFati's answer) for more details regarding how code gets transformed. When dealing with an .exe that depends on (loads) .dlls, there are certain restrictions:
The .exe (in this case python.exe)'s architecture (32 vs. 64 bit or (x86 vs. x64 (or AMD64))) must match the one of any .dll that it loads (and other .dll that a loaded .dll loads, and so on), so all the dlls in the dependency tree, otherwise the .dll won't load
The platform (Debug vs. Release) should match in some cases. Here's what could happen if it didn't: [SO]: When using fstream in a library I get linker errors in the executable (@CristiFati's answer), but I don't think that we are in that situation
- The build tools should also match in some (other) cases. Examples:
- Compiler type ([SO]: Python extensions with C: staticforward (@CristiFati's answer))
- The CRT runtime ([SO]: Errors when linking to protobuf 3 on MSVC 2013 (@CristiFati's answer))
- The CRT runtime version is important in our case. Check [Python.Wiki]: WindowsCompilers for compatibilities between Python and VStudio versions. Note that this only applies for Python versions downloaded and installed (if you built your Python from sources, then you should use the same build tool - but I guess it's not the case here)
- I see you are using VStudio 2017, so the compatible versions are Python 3.5 and Python 3.6 1. I have ~10 Python installations on my machine (some installed, some built by me - with different compiler; most of them are x64, I also have some VEnvs, but that shouldn't make any difference). I also have 5 VStudio versions installed, in my case, setup.py automatically selects VStudio 2015 (but it's ok, since as VStudio 2017 it has compiler v14.0)
- simstring depends on libiconv which also comes as a .dll (actually there are more, but we only care about one). Checking the .dll (see below) with Dependency Walker reveals that it's x86 2. That means that either:
- Python 32bit (x86) should be used. This is the variant that I'm going to go with. From 1 and 2, the only available version on my machine is Python 3.6 x86 (Python 3.5 is my version of choice, I also have it in 32bit format, but I messed it up and didn't reinstall it)
- Build libiconv from source, and get rid of restriction 2. But, that could take time, and it's outside the scope of the current question. If there will be a question about building it, I'll take some time and give it a shot, as I enjoy that kind of tasks ([SO]: How to build a DLL version of libjpeg 9b? (@CristiFati's answer))
Walkthrough:
- Create a dir and cd to it (should be empty). This will be the %ROOT_DIR%, and all the paths that I'm going to use will be relative to it (except of course for absolute ones), and this will be the default dir (when unspecified)
- Download simstring sources ([GitHub]: Georgetown-IR-Lab/simstring - simstring-master.zip)
- Unzip the archive - it will do it in a dir simstring-master (will be automatically created)
- Create a dir libiconv. Inside it, download:
- [SourceForge]: gnuwin32/GnuWin - libiconv-1.9.2-1-lib.zip
- [SourceForge]: gnuwin32/GnuWin - libiconv-1.9.2-1-bin.zip
- Extract needed stuff from these files:
- From #1.:
- include dir - used at compile phase
- lib dir - used at link phase
- Both phases are performed by setup.py (below)
- From #2.:
- bin dir - used at runtime (when using (importing) the module)
- From #1.:
- cd to the simstring-master dir. To build the extension, I'm using setup.py's build_ext command (invoked recursively by install - as seen in your output): [Python 3]: distutils.command.build_ext - Build any extensions in a package
Running build_ext, will yield your error:
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install simstring
You can use simstring like any standard Python library. You will need to make sure that you have a development environment consisting of a Python distribution including header files, a compiler, pip, and git installed. Make sure that your pip, setuptools, and wheel are up to date. When using pip it is generally recommended to install packages in a virtual environment to avoid changes to the system.
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page