Metadata-Version: 2.1
Name: recombinant
Version: 1.1.0
Summary: Phonotactic generalization using recombination
Author-email: Ignas Rudaitis <ignas.rudaitis@gmail.com>
License: MIT License
        
        Copyright (c) 2022 Ignas Rudaitis
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
Keywords: linguistics,phonotactics
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3
Requires-Python: >=3.7
Description-Content-Type: text/markdown
License-File: LICENSE

# Introduction

This library is meant to supplement the presentation [_Phonotactic well-formedness is recombinant_](https://bit.ly/sle-recombinant), given at the [55th Annual Meeting of the SLE](https://societaslinguistica.eu/sle2022/).

It learns typologically diverse phonotactics from positive examples alone.

# Installation

```
pip install recombinant
```

# Example

Here, we generalize the set /miememei, oumumo, momomu, iememi/ and then elicit ratings for /meem, memo, mumo/.

```python
from recombinant import Learner

L = Learner([
    'miememei',
    'oumumo',
    'momomu',
    'iememi',
])

L.optimize()

print(L.rate('meem')) # => 0.4873949579831933 
print(L.rate('memo')) # => 0
print(L.rate('mumo')) # => 0.7899159663865546
print(L.basis)        # => ['momu', 'momo', 'oumo', 'memi', 'mi', 'emi', ...]
```

The actual learning takes place during the call to `L.optimize()`. Sometimes, running this optimization routine more than once gives better results.
