def run(unihan_options={}):
    """Wrapped so we can test in tests/test_examples.py"""
    print("This example prints variant character data.")

    c = Cihai()
    if not c.unihan.is_bootstrapped:  # download and install Unihan to db
        c.unihan.bootstrap(unihan_options)

    c.unihan.add_plugin(
        'cihai.data.unihan.dataset.UnihanVariants', namespace='variants'
    )

    print("## ZVariants")
    variant_list(c.unihan, "kZVariant")

    print("## kSemanticVariant")
    variant_list(c.unihan, "kSemanticVariant")

    print("## kSpecializedSemanticVariant")
    variant_list(c.unihan, "kSpecializedSemanticVariant")
def run ( unihan_options = { } ) : print ( "This example prints variant character data." ) c = Cihai ( ) if not c . unihan . is_bootstrapped : c . unihan . bootstrap ( unihan_options ) c . unihan . add_plugin ( 'cihai.data.unihan.dataset.UnihanVariants' , namespace = 'variants' ) print ( "## ZVariants" ) variant_list ( c . unihan , "kZVariant" ) print ( "## kSemanticVariant" ) variant_list ( c . unihan , "kSemanticVariant" ) print ( "## kSpecializedSemanticVariant" ) variant_list ( c . unihan , "kSpecializedSemanticVariant" )
Wrapped so we can test in tests/test_examples.py