Skip to content

v0.2.0

Choose a tag to compare

@aaronstevenwhite aaronstevenwhite released this 30 Sep 20:17
f708c7d

This minor release adds symbol parsing, fuzzy search, and syntax-based search capabilities to Glazing.

✨ What's New

Symbol Parsing

Parse linguistic identifiers from all four datasets to extract structured information:

>>> from glazing.propbank.symbol_parser import parse_roleset_id
>>> result = parse_roleset_id("give.01")
>>> result.lemma
'give'
>>> result.sense_number
1

Fuzzy String Matching

Find approximate matches using Levenshtein distance:

>>> from glazing.search import UnifiedSearch
>>> searcher = UnifiedSearch()
>>> results = searcher.search_with_fuzzy("comunication", fuzzy_threshold=0.8)
>>> # Returns results including "Communication" frames

Syntax-Based Search

Search across datasets using syntactic patterns:

>>> from glazing.search import UnifiedSearch
>>> searcher = UnifiedSearch()
>>> results = searcher.search_by_syntax(
...     pattern="NP V NP PP[to]",  # Ditransitive pattern
...     allow_wildcards=True
... )
>>> # Returns 52 matching patterns

Enhanced Cross-References

New MappingIndex class provides transitive reference resolution with caching:

  • Discover indirect mappings between datasets
  • File-based caching for performance
  • Configurable hop limits for transitive searches

🔧 CLI Enhancements

New Commands

  • glazing search query --fuzzy - Enable fuzzy matching for typo correction
  • glazing search fuzzy - Search with fuzzy matching and typo correction
  • glazing search syntax - Search for syntactic patterns with morphological features
  • glazing search args - Search for arguments with specific properties
  • glazing search role - Search for semantic roles across datasets
  • glazing search roles - Search for semantic roles with specific properties
  • glazing search elements - Search for frame elements with specific properties
  • glazing search relations - Search for synsets with specific relations
  • glazing xref resolve - Resolve cross-references for an entity
  • glazing xref extract - Extract cross-references from all datasets
  • glazing xref clear-cache - Clear cached cross-references

Improvements

  • Progress indicators for long-running operations
  • Better error messages and help text

🐳 Docker Support

New Dockerfile for containerized deployment:

# Use official Python 3.13 slim image as base
FROM python:3.13-slim

# Set working directory
WORKDIR /app

# Set environment variables
ENV PYTHONDONTWRITEBYTECODE=1 \
    PYTHONUNBUFFERED=1 \
    PIP_NO_CACHE_DIR=1 \
    PIP_DISABLE_PIP_VERSION_CHECK=1

# Install system dependencies required for building packages
RUN apt-get update && apt-get install -y --no-install-recommends \
    gcc \
    g++ \
    && rm -rf /var/lib/apt/lists/*

# Copy only requirements first to leverage Docker cache
COPY pyproject.toml README.md ./
COPY src/glazing/__version__.py src/glazing/

# Install package dependencies
RUN pip install --upgrade pip && \
    pip install -e .

# Copy the rest of the application code
COPY src/ src/
COPY tests/ tests/

# Create data directory for datasets
RUN mkdir -p /data

# Set environment variable for data directory
ENV GLAZING_DATA_DIR=/data

# Initialize datasets during build
RUN glazing init --data-dir /data

# Expose data directory as volume
VOLUME ["/data"]

# Set the entrypoint to the glazing CLI
ENTRYPOINT ["glazing"]

# Default command shows help
CMD ["--help"]

📚 New Documentation

  • User Guides:
    • Fuzzy search guide (docs/user-guide/fuzzy-search.md)
    • Syntax search guide (docs/user-guide/syntax-search.md)
  • API Documentation:
    • Symbol parsers for all datasets (4 files)
    • Fuzzy matching utilities
    • Syntax pattern models
  • Data Formats: JSON schemas added to data-formats.md

📦 Technical Changes

New Modules

  • glazing.syntax - Syntactic pattern models and parser
  • glazing.utils.fuzzy_match - String similarity functions
  • glazing.utils.ranking - Result ranking utilities
  • glazing.references.index - Mapping index implementation
  • glazing.symbols - Symbol type definitions
  • glazing.{dataset}.symbol_parser - Parse dataset identifiers (4 modules)

Dependencies

  • Added python-Levenshtein>=0.20.0 for fuzzy matching

📦 Updating

pip install --upgrade glazing==0.2.0

Requirements:

  • Python 3.13 or higher
  • New dependency: python-Levenshtein>=0.20.0

🔧 Compatibility

  • Fully backwards compatible with v0.1.x
  • No breaking changes
  • All existing APIs continue to work

📜 Citation

If you use this version of Glazing in your research, please cite:

@software{glazing2025,
  author = {White, Aaron Steven},
  title = {Glazing: Unified Data Models and Interfaces for Syntactic and Semantic Frame Ontologies},
  year = {2025},
  url = {https://github.com/aaronstevenwhite/glazing},
  version = {0.2.0},
  doi = {10.5281/zenodo.17185626}
}

🙏 Acknowledgments

This project is funded by the National Science Foundation (BCS-2040831).

📮 Contact


Full Changelog: v0.1.1...v0.2.0